How baikoby228/sale-hunter works
Project type and purpose
• This is a Python-based “sale-hunter” application that monitors prices on marketplaces (e.g., Ozon, Wildberries), lets users subscribe to product price changes via a bot interface (likely Telegram), stores user and product sessions in a database, and pushes notifications when certain criteria are met.
File structure
• Top level
• bot.py: Entry point for user interaction (receives commands/messages)
• monitor.py: Scheduled or manual runner that triggers price checks
• config/: Global constants and configuration
• infra/database/: Database connector modules (users, products)
• app/: Core application logic
– parsers/: Marketplace-specific scrapers (ozon, wb)
– processing/: Command handlers organized by “add”, “del”, “set”, “menu”, “help”, “start”, etc.
– session/: In-memory or persistent session managers for user and product data
– notification.py: Logic to send notifications to users
• models/: Data model definitions for products and users
• utils/: Helper functions (price parsing, callback data, formatting)
• Key patterns:
– Layered architecture (Bot → Command Processing → Business Logic → Data Access → External APIs)
– Command-handler subpackages reflect the Command pattern
– Parsers implement a Strategy pattern for different marketplaces
README
• The README simply states “sale-hunter,” confirming the name but relying on code structure for details.