Skip to content

ernestothorp/Flask_Football

 
 

Repository files navigation

Football

This small project can import football results via API and analyse the data in flask.

It was created to learn flask, API integration, data processing and data visualization.

Note: The project has been migrated from web scraping to using API-Football.com. See API_MIGRATION.md for details.

Features

  • flask generates an interactive GUI environment
  • extract soccer results from API-Football.com (German Bundesliga, 2. Bundesliga, 3. Liga)
  • format and save the data in CSV-files automatically
  • get season overviews
  • create dynamic data diagrams
  • calculate the attack/defence value of each club and try to predict the results (based on poisson)
  • compare the predicted and real results by using the coefficient of determination (R²)



First Steps:

Setup API Key

  1. Get a free API key from RapidAPI API-Football
  2. Set environment variable: export API_FOOTBALL_KEY="your_key"
  3. Or edit GET_Data_API.py and add your key directly

See API_MIGRATION.md for detailed setup instructions.

Import results

  • open main.py and configure league and season:
league_name = "1_Bundesliga"  # or "2_Bundesliga", "3_Liga"
season = 2024
  • run:
GET_ALL_ROUNDS(league_name, season, max_rounds=34)
  • results will be saved in a CSV-file automatically (folder: CSV)

Select a data source

  • open main.py and select the CSV-file you want to work with:
file = "./CSV/1_Bundesliga_2024.csv"



GUI

start START_Gui.py (default IP: 127.0.0.1:5000)

choose a club in the dropdown menu:

drawing

now you can switch between the options and analyse the data:

drawing



Example calculation:


drawing

About

This small project can import football results by using a webcrawler and analyse the data in flask.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 76.5%
  • HTML 23.4%
  • Makefile 0.1%