Skip to content

About

Football match data pipeline: Kafka, Logstash, Elasticsearch and PySpark over ~1900 matches from 5 European leagues.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Football Pipeline

Projet de collecte, indexation et analyse de matchs de football. Données : 5 ligues européennes, saison 2023-2024, ~1900 matchs.

Architecture

API-Football v3 -> Producteur Python -> Kafka -> Logstash -> Elasticsearch -> Kibana
                                                                  |
                                                              PySpark

Structure

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

Pré-requis

  • Docker Desktop (Compose v2)
  • Python 3.10+
  • Java 11+ (pour PySpark)

Installation et exécution

# 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:9200

Spark (optionnel)

cd spark
pip install pyspark
python job_read_es_compute.py

Arrêt

docker-compose down -v

About

Football match data pipeline: Kafka, Logstash, Elasticsearch and PySpark over ~1900 matches from 5 European leagues.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages