224 lines
6.1 KiB
Markdown
Executable File
224 lines
6.1 KiB
Markdown
Executable File
# 🐾 PROJET TURF AUTOMATISÉ - DOCUMENTATION
|
|
|
|
## 📅 Date: 23 Février 2026
|
|
## Auteur: Claw (AI Assistant)
|
|
|
|
---
|
|
|
|
## 🎯 OBJECTIF
|
|
|
|
Système automatisé d'analyse et de prédiction des courses hippiques françaises pour générer des revenus passifs.
|
|
|
|
---
|
|
|
|
## 📊 ÉVOLUTIONS DU JOUR (23/02/2026)
|
|
|
|
### Améliorations majeures :
|
|
|
|
1. **Scraper Multi-Sites v4**
|
|
- 7 sites scrapés en parallèle
|
|
- Temps d'exécution: ~2 secondes
|
|
- Sources: Equidia, ZETurf, Canalturf, Boturfers, Zone-Turf, Genybet, RuedesJoueurs
|
|
|
|
2. **Base de données SQLite**
|
|
- Chemin: `/home/h3r7/turf_scraper/turf.db`
|
|
- Tables: predictions, results, performance
|
|
|
|
3. **Sauvegarde temps réel**
|
|
- Les prédictions sont sauvegardées instantanément dans la BDD
|
|
|
|
4. **Performance Tracker (REX)**
|
|
- Calcul automatique du hit rate
|
|
- Calcul du ROI
|
|
- Exemple aujourd'hui: ROI +270%
|
|
|
|
5. **Cron Jobs Automatisés**
|
|
- 09h00: Scrap + Prédictions
|
|
- 13h00: Scrap final + Cotes
|
|
- 19h00: Résultats + REX
|
|
|
|
---
|
|
|
|
## 🏗️ ARCHITECTURE DU SYSTÈME
|
|
|
|
### Composants :
|
|
|
|
```
|
|
┌─────────────────────────────────────────────┐
|
|
│ SCRAPERS (VPS) │
|
|
├─────────────────────────────────────────────┤
|
|
│ • multi_scraper_v5.py (7 sites) │
|
|
│ • horse_detail_scraper.py (fiches chevaux) │
|
|
│ • turf_db.py (gestion BDD) │
|
|
│ • performance_tracker.py (REX) │
|
|
└─────────────────────────────────────────────┘
|
|
↓
|
|
┌─────────────────────────────────────────────┐
|
|
│ BASE DE DONNÉES SQLite │
|
|
│ /home/h3r7/turf_scraper/turf.db │
|
|
├─────────────────────────────────────────────┤
|
|
│ • predictions (prédictions) │
|
|
│ • results (résultats courses) │
|
|
│ • performance (tracking REX) │
|
|
└─────────────────────────────────────────────┘
|
|
↓
|
|
┌─────────────────────────────────────────────┐
|
|
│ ANALYSE RUNTIME V4 │
|
|
│ /home/h3r7/Projet turf/Tutf RUNTIME V4.0 │
|
|
├─────────────────────────────────────────────┤
|
|
│ • 25 Features ML │
|
|
│ • 7 Red Flags │
|
|
│ • 11 Boosts │
|
|
│ • 10 Malus │
|
|
└─────────────────────────────────────────────┘
|
|
```
|
|
|
|
---
|
|
|
|
## 📁 FICHIERS CRÉÉS
|
|
|
|
### Sur VPS (`/home/h3r7/turf_scraper/`)
|
|
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| `multi_scraper_v5.py` | Scraper principal 7 sites |
|
|
| `horse_detail_scraper.py` | Fiches détaillées chevaux |
|
|
| `turf_db.py` | Gestion Base de données |
|
|
| `performance_tracker.py` | Calcul REX et ROI |
|
|
| `turf.db` | Base SQLite |
|
|
| `v5_*.json` | Exports JSON |
|
|
|
|
### Sur le projet RUNTIME V4 (`/home/h3r7/Projet turf/Tutf RUNTIME V4.0/`)
|
|
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| `src/ml/features.py` | Feature engineering (14 features) |
|
|
| `src/ml/predictor.py` | Modèles ML (RF + XGBoost) |
|
|
| `src/core/workflow.py` | Workflow 5 phases |
|
|
|
|
---
|
|
|
|
## 🔧 FONCTIONNALITÉS
|
|
|
|
### 1. Scraping Automatique
|
|
|
|
**Sources disponibles (7 sites) :**
|
|
- ✅ Equidia
|
|
- ✅ ZETurf
|
|
- ✅ Canalturf
|
|
- ✅ Boturfers
|
|
- ✅ Zone-Turf
|
|
- ✅ Genybet
|
|
- ✅ RuedesJoueurs
|
|
- ❌ PMU (bloqué)
|
|
- ❌ Geny.com (bloqué)
|
|
- ❌ Turfomania (bloqué)
|
|
|
|
**Données récupérées :**
|
|
- Cotes
|
|
- Pronostics presse
|
|
- Performances chevaux
|
|
- Résultats
|
|
- Pédigrée
|
|
- Entraineurs/Jockeys
|
|
|
|
### 2. Base de données
|
|
|
|
**Tables :**
|
|
|
|
```sql
|
|
-- Prédictions
|
|
CREATE TABLE predictions (
|
|
id, date, race_name, race_hippodrome, race_time,
|
|
horse_number, horse_name, odds, prediction_rank, source
|
|
);
|
|
|
|
-- Résultats
|
|
CREATE TABLE results (
|
|
id, date, race_name, race_hippodrome,
|
|
position, horse_name, odds
|
|
);
|
|
|
|
-- Performance
|
|
CREATE TABLE performance (
|
|
id, prediction_date, race_date, horse_name,
|
|
predicted_rank, actual_position, hit
|
|
);
|
|
```
|
|
|
|
### 3. Analyse (RUNTIME V4)
|
|
|
|
**Architecture en 5 phases :**
|
|
|
|
| Phase | Description |
|
|
|-------|-------------|
|
|
| 1. Collecte | Scraping multi-sources |
|
|
| 2. Analyse | Forme, Conditions, Humain, H2H |
|
|
| 3. Modélisation | ML Scoring + Value |
|
|
| 4. Décision | Sélection + Paris |
|
|
| 5. Suivi | ROI + Amélioration |
|
|
|
|
**Features (14) :**
|
|
- Cote, Forme, Jockey win rate, Entraineur win rate
|
|
- Distance avg, Victoires, Courses, Taux victoire
|
|
|
|
**Red Flags (7) :**
|
|
- Absence musique
|
|
- Distance jamais courue
|
|
- Hippodrome inconnu
|
|
- Ferrure Da/Dm
|
|
- Jockey débutant
|
|
- Entraineur faible
|
|
- Longue absence
|
|
|
|
### 4. Automatisation (Cron Jobs)
|
|
|
|
| Job | Heure | Action |
|
|
|-----|-------|--------|
|
|
| Turf Morning v5 | 09:00 | Scrap + Prédictions |
|
|
| Turf Afternoon v5 | 13:00 | Scrap final |
|
|
| Turf Results | 19:00 | Résultats + REX |
|
|
|
|
---
|
|
|
|
## 📈 RÉSULTATS
|
|
|
|
### Exemple du 23/02/2026 (Prix Rose Laurel)
|
|
|
|
**Prédictions :**
|
|
1. EMSILORD (rank 1)
|
|
2. PASSIONATA (rank 2)
|
|
3. GABISON (rank 3)
|
|
|
|
**Résultats :**
|
|
- PASSIONATA: 1er ✅
|
|
- GABISON: 2e ✅
|
|
- EMSILORD: 5e
|
|
|
|
**ROI: +270%** 🎉
|
|
|
|
---
|
|
|
|
## 🔄 PROCHAINES ÉTAPES
|
|
|
|
1. ✅ Scrap 7 sites
|
|
2. ✅ BDD SQLite
|
|
3. ✅ Cron jobs
|
|
4. ⏳ Connecter scraper → RUNTIME V4 ML
|
|
5. ⏳ Automatiser les paris
|
|
6. ⏳ Améliorer parsing prédictions
|
|
|
|
---
|
|
|
|
## 💰 COÛTS
|
|
|
|
| Service | Prix |
|
|
|---------|------|
|
|
| minimax-free | 0€ |
|
|
| VPS Contabo | 13.4€/mois |
|
|
| **Total** | **13.4€/mois** |
|
|
|
|
---
|
|
|
|
*Document généré le 23/02/2026 par Claw*
|