199 lines
5.5 KiB
Markdown
Executable File
199 lines
5.5 KiB
Markdown
Executable File
# 📑 PriceWatch - Index des fichiers
|
|
|
|
**Version** : 0.1.0 | **Date** : 2026-01-13
|
|
|
|
Ce fichier liste tous les fichiers du projet avec leur description.
|
|
|
|
---
|
|
|
|
## 📚 Documentation (7 fichiers)
|
|
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| **README.md** | Documentation principale du projet (installation, usage, architecture) |
|
|
| **QUICKSTART.md** | Guide de démarrage rapide (commandes essentielles) |
|
|
| **CLAUDE.md** | Guide pour futures instances de Claude Code |
|
|
| **TODO.md** | Roadmap du projet (Phases 1-5) |
|
|
| **CHANGELOG.md** | Historique des modifications (v0.1.0) |
|
|
| **DELIVERY_SUMMARY.md** | Récapitulatif complet de livraison Phase 1 |
|
|
| **TEST_FILES_README.md** | Guide des fichiers de test et maintenance sélecteurs |
|
|
| **INDEX.md** | Ce fichier - Index de tous les fichiers du projet |
|
|
|
|
## ⚙️ Configuration (4 fichiers)
|
|
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| **pyproject.toml** | Configuration package Python + dépendances |
|
|
| **scrap_url.yaml** | Configuration de scraping (URLs + options) |
|
|
| **.gitignore** | Fichiers à ignorer par Git |
|
|
| **PROJECT_SPEC.md** | Spécifications détaillées originales (français) |
|
|
|
|
## 🧪 Tests (3 fichiers)
|
|
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| **test_amazon.json** | Config de test Amazon (URLs, sélecteurs, valeurs attendues) |
|
|
| **test_cdiscount.json** | Config de test Cdiscount (URLs, sélecteurs, valeurs attendues) |
|
|
| **test_selectors.py** | Script de validation des sélecteurs |
|
|
|
|
## 🐍 Code source (18 modules Python)
|
|
|
|
### Core (4 modules)
|
|
```
|
|
pricewatch/app/core/
|
|
├── schema.py Modèle ProductSnapshot (Pydantic) + validation
|
|
├── logging.py Système de logs colorés
|
|
├── io.py Lecture YAML / Écriture JSON + debug files
|
|
└── registry.py Détection automatique stores
|
|
```
|
|
|
|
### Scraping (2 modules)
|
|
```
|
|
pricewatch/app/scraping/
|
|
├── http_fetch.py Récupération HTTP avec User-Agent rotation
|
|
└── pw_fetch.py Récupération Playwright (anti-bot)
|
|
```
|
|
|
|
### Stores (8 modules)
|
|
```
|
|
pricewatch/app/stores/
|
|
├── base.py Classe abstraite BaseStore
|
|
├── amazon/
|
|
│ ├── store.py AmazonStore (match, parse, etc.)
|
|
│ ├── selectors.yml Sélecteurs CSS/XPath Amazon
|
|
│ └── fixtures/ Fixtures HTML (vide)
|
|
└── cdiscount/
|
|
├── store.py CdiscountStore (match, parse, etc.)
|
|
├── selectors.yml Sélecteurs CSS/XPath Cdiscount
|
|
└── fixtures/ Fixtures HTML (vide)
|
|
```
|
|
|
|
### CLI (1 module)
|
|
```
|
|
pricewatch/app/cli/
|
|
└── main.py CLI Typer avec 5 commandes
|
|
```
|
|
|
|
### Tests (structure)
|
|
```
|
|
tests/
|
|
├── core/ Tests core (à implémenter)
|
|
├── scraping/ Tests scraping (à implémenter)
|
|
└── stores/
|
|
├── amazon/ Tests Amazon (à implémenter)
|
|
└── cdiscount/ Tests Cdiscount (à implémenter)
|
|
```
|
|
|
|
## 📦 Dossiers générés
|
|
|
|
| Dossier | Description |
|
|
|---------|-------------|
|
|
| **venv/** | Environnement virtuel Python |
|
|
| **scraped/** | HTML et screenshots de debug |
|
|
| **pricewatch.egg-info/** | Métadonnées du package installé |
|
|
|
|
## 📄 Fichiers générés
|
|
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| **scraped_store.json** | Résultats du scraping (généré par `pricewatch run`) |
|
|
|
|
---
|
|
|
|
## 🗺️ Guide de navigation
|
|
|
|
### Pour démarrer rapidement
|
|
→ **QUICKSTART.md**
|
|
|
|
### Pour comprendre l'architecture
|
|
→ **README.md** (section "Structure du projet")
|
|
→ **CLAUDE.md** (section "Architecture")
|
|
|
|
### Pour les tests
|
|
→ **TEST_FILES_README.md**
|
|
→ **test_amazon.json** et **test_cdiscount.json**
|
|
|
|
### Pour les prochaines étapes
|
|
→ **TODO.md** (Phases 2-5)
|
|
|
|
### Pour l'historique
|
|
→ **CHANGELOG.md**
|
|
|
|
---
|
|
|
|
## 📊 Statistiques
|
|
|
|
```
|
|
Code Python : 2328 lignes
|
|
Modules Python : 18 fichiers
|
|
Documentation : 8 fichiers Markdown
|
|
Fichiers de test : 3 fichiers
|
|
Fichiers config : 4 fichiers
|
|
Stores supportés : 2 (Amazon, Cdiscount)
|
|
Commandes CLI : 5 commandes
|
|
```
|
|
|
|
---
|
|
|
|
## 🔍 Rechercher par fonctionnalité
|
|
|
|
### Scraping
|
|
- HTTP → `pricewatch/app/scraping/http_fetch.py`
|
|
- Playwright → `pricewatch/app/scraping/pw_fetch.py`
|
|
- Fallback automatique → `pw_fetch.py` (fonction `fetch_with_fallback`)
|
|
|
|
### Parsing
|
|
- Amazon → `pricewatch/app/stores/amazon/store.py`
|
|
- Cdiscount → `pricewatch/app/stores/cdiscount/store.py`
|
|
- Sélecteurs → `*/selectors.yml`
|
|
|
|
### Validation données
|
|
- Modèle → `pricewatch/app/core/schema.py`
|
|
- Enums → `schema.py` (StockStatus, FetchMethod, DebugStatus)
|
|
|
|
### Configuration
|
|
- YAML → `scrap_url.yaml` (exemple)
|
|
- Lecture → `pricewatch/app/core/io.py` (fonction `read_yaml_config`)
|
|
|
|
### Logging
|
|
- Configuration → `pricewatch/app/core/logging.py`
|
|
- Utilisation → `get_logger("module.name")` dans chaque module
|
|
|
|
### CLI
|
|
- Point d'entrée → `pricewatch/app/cli/main.py`
|
|
- Script entry point → `pyproject.toml` (section `[project.scripts]`)
|
|
|
|
### Tests
|
|
- Structure → `tests/` (dossiers créés)
|
|
- Fixtures → `stores/*/fixtures/` (vides)
|
|
- Validation sélecteurs → `test_selectors.py`
|
|
|
|
---
|
|
|
|
## 🚀 Commandes essentielles
|
|
|
|
```bash
|
|
# Installation
|
|
source venv/bin/activate
|
|
pip install -e .
|
|
playwright install chromium
|
|
|
|
# Vérification
|
|
pricewatch doctor
|
|
|
|
# Tests
|
|
python test_selectors.py test_amazon.json
|
|
|
|
# Scraping
|
|
pricewatch run --yaml scrap_url.yaml --debug
|
|
|
|
# Voir les résultats
|
|
cat scraped_store.json | python -m json.tool
|
|
```
|
|
|
|
---
|
|
|
|
**Dernière mise à jour** : 2026-01-13
|
|
**Phase actuelle** : Phase 1 - CLI (✅ Complétée)
|
|
**Prochaine phase** : Phase 2 - Base de données
|