This commit is contained in:
2026-01-14 07:03:38 +01:00
parent ecda149a4b
commit c91c0f1fc9
61 changed files with 4388 additions and 38 deletions

View File

@@ -58,6 +58,13 @@ pricewatch/
│ │ ├── store.py
│ │ ├── selectors.yml
│ │ └── fixtures/
│ ├── db/ # Persistence SQLAlchemy (Phase 2)
│ │ ├── models.py
│ │ ├── connection.py
│ │ └── migrations/
│ ├── tasks/ # Jobs RQ (Phase 3)
│ │ ├── scrape.py
│ │ └── scheduler.py
│ └── cli/
│ └── main.py # CLI Typer
├── tests/ # Tests pytest
@@ -76,6 +83,9 @@ pricewatch run --yaml scrap_url.yaml --out scraped_store.json
# Avec debug
pricewatch run --yaml scrap_url.yaml --out scraped_store.json --debug
# Avec persistence DB
pricewatch run --yaml scrap_url.yaml --out scraped_store.json --save-db
```
### Commandes utilitaires
@@ -97,6 +107,45 @@ pricewatch parse amazon --in scraped/page.html
pricewatch doctor
```
### Commandes base de donnees
```bash
# Initialiser les tables
pricewatch init-db
# Generer une migration
pricewatch migrate "Initial schema"
# Appliquer les migrations
pricewatch upgrade
# Revenir en arriere
pricewatch downgrade -1
```
### Commandes worker
```bash
# Lancer un worker RQ
pricewatch worker
# Enqueue un job immediat
pricewatch enqueue "https://example.com/product"
# Planifier un job recurrent
pricewatch schedule "https://example.com/product" --interval 24
```
## Base de donnees (Phase 2)
```bash
# Lancer PostgreSQL + Redis en local
docker-compose up -d
# Exemple de configuration
cp .env.example .env
```
## Configuration (scrap_url.yaml)
```yaml
@@ -196,8 +245,8 @@ Aucune erreur ne doit crasher silencieusement : toutes sont loggées et tracées
- ✅ Tests pytest
### Phase 2 : Persistence
- [ ] Base de données PostgreSQL
- [ ] Migrations Alembic
- [x] Base de données PostgreSQL
- [x] Migrations Alembic
- [ ] Historique des prix
### Phase 3 : Automation