Monitor retailer listings for the Leica MP Black Chrome and send Discord alerts whenever new matches appear.
Current Status: Phase 0 (Scaffolding) - This project is being developed in phases. Currently, only the basic project structure, configuration, logging, and CLI entry point are implemented.
- Phase 0 (Current): Minimal scaffolding - project structure, config loader, logging, CLI entry point
- Phase 1: Single retailer scraper with console output
- Phase 2: Local state persistence and deduplication
- Phase 3: Discord webhook notifications
- Phase 4: Second retailer and shared abstractions
- Phase 5: Docker and Synology deployment
-
Create a virtual environment and install dependencies:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt -
(Optional) Copy
.env.exampleto.envfor configuration:cp .env.example .env
-
Run the monitor:
python3 -m monitor
Note: Phase 0 is a placeholder that logs startup/shutdown messages. No scraping, notifications, or persistence is implemented yet.
Configuration is loaded from a .env file (optional in Phase 0). See .env.example for available options. Configuration variables will be added in later phases:
- Phase 1:
POLL_INTERVAL_SECONDS- Poll interval in seconds - Phase 2:
STATE_FILE_PATH- Path to state persistence file - Phase 3:
DISCORD_WEBHOOK_URL- Discord webhook endpoint
monitor/
├── __init__.py # Logging configuration
├── __main__.py # CLI entry point
├── cli.py # Main run() function
├── config.py # Configuration loader
└── scrapers/ # (Phase 1+) Retailer scrapers
- Python 3.12+
python-dotenv(for .env file loading)
Development dependencies (optional, for linting/formatting):
- Install with:
pip install -r requirements-dev.txt
This project uses Ruff for both linting and code formatting.
Check for issues:
python3 -m ruff check monitor/Auto-fix issues:
python3 -m ruff check --fix monitor/Format code:
python3 -m ruff format monitor/Check and format in one command:
python3 -m ruff check --fix monitor/ && python3 -m ruff format monitor/Configuration is in pyproject.toml under [tool.ruff].
This project uses pre-commit to automatically run Ruff linting and formatting before each commit.
First-time setup:
# Install development dependencies (includes pre-commit)
pip install -r requirements-dev.txt
# Install git hooks
pre-commit installAfter installation, pre-commit will automatically:
- Run Ruff linting (with auto-fix)
- Run Ruff formatting
on every git commit. If issues are found, the commit will be blocked until they're fixed.
Run hooks manually (without committing):
pre-commit run --all-filesSkip hooks (not recommended):
git commit --no-verify- Poll multiple Leica retailers (
mapcamera.com,tamarkin.com,camerawest.com,kitamuracamera.jp) - Filter listings for "Leica MP" plus Black Chrome keyword variants
- Deduplicate alerts with on-disk state tracking
- Discord webhook notifications
- Docker setup for Synology NAS deployment