This Python Flask application retrieves football competition data, such as standings, upcoming matches, and completed scores, from the football-data.org API. Users can select different competitions and seasons to view relevant information. All data cached by FLask-cache and stored in local MongoDB for best performance
- List Competitions: Select between various popular football leagues.
- View Standings: Shows current standings for the selected competition.
- Upcoming Matches: Displays the schedule of upcoming matches.
- Completed Matches: Provides scores of completed matches (delayed scores).
- Season Selection: Choose the desired season/year for viewing data.
- Python 3.7+ (make sure Python is installed)
- Football-Data API Key: Obtain an API key by registering at football-data.org.
-
Clone the repository to your local machine:
git clone <your-repository-url>
-
Navigate to the project's directory:
cd <your-project-folder>
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install the required dependencies:
pip install -r requirements.txt
-
Install mongoDB and create a Database
-
Run mongoDB at port 27017
-
Run the Flask application:
python main.py
-
Open the browser to http://localhost:8000.
-
Select the desired competition and season, and explore standings, upcoming matches, and scores.
main.py
: Main application file containing the Flask routes and logic.api.py
: Api interface.templates/index.html
: HTML template used for rendering the main page.requirements.txt
: Python dependencies required to run the project.
- Flask: Python web framework
- Requests: For handling API requests
- MongoDB For long-term caching
Feel free to open issues or submit pull requests if you'd like to add features, fix bugs, or improve the documentation.