Projet de collecte, indexation et analyse de matchs de football. Données : 5 ligues européennes, saison 2023-2024, ~1900 matchs.
API-Football v3 -> Producteur Python -> Kafka -> Logstash -> Elasticsearch -> Kibana
|
PySpark
football-pipeline/
├── docker-compose.yml
├── .env # variables d'environnement (a renseigner)
├── .env.example
├── producer/
│ ├── config.py # ligues, saison, parametres Kafka
│ ├── fetch_and_produce.py # collecte API et envoi sur Kafka
│ └── requirements.txt
├── kafka/
│ └── topics.sh # creation du topic football_matches
├── logstash/
│ ├── pipeline/kafka_to_es.conf # pipeline ETL : Kafka -> Elasticsearch
│ └── templates/index-template.json
├── elasticsearch/
│ └── queries/
│ ├── 01_text_query.json
│ ├── 02_aggregation.json
│ ├── 03_ngram.json
│ ├── 04_fuzzy.json
│ ├── 05_timeseries.json
│ └── 06_bool_query.json
└── spark/
├── job_read_es_compute.py
└── pyspark_es_config.py
- Docker Desktop (Compose v2)
- Python 3.10+
- Java 11+ (pour PySpark)
# 1. Configurer les variables d'environnement
cp .env.example .env
# Renseigner API_FOOTBALL_KEY dans .env
# 2. Démarrer l'infrastructure
docker-compose up -d
# 3. Créer le topic Kafka
bash kafka/topics.sh
# 4. Lancer le producteur
cd producer
pip install -r requirements.txt
python fetch_and_produce.py
# 5. Accéder aux services
# Kibana : http://localhost:5601
# Elasticsearch : http://localhost:9200cd spark
pip install pyspark
python job_read_es_compute.pydocker-compose down -v