A Python library for fetching, organizing, storing, and serving fantasy football data locally.
Fantasy API provides a reusable data layer for applications that need access to fantasy football player, team, match, and performance data. It fetches data from external sources, normalizes and stores it locally, and can optionally expose the stored data through a local API.
It was originally built as the data layer for Fantasy RL, a reinforcement learning project for fantasy football management.
- Fetch fantasy football data from external sources
- Store datasets locally for reliable and repeatable access
- Update and refresh local data using the included update utilities
- Provide structured access to player, team, match, and performance data
- Optionally serve locally stored data through an API
- Designed as a reusable Python library
- Suitable for machine learning and sports analytics workflows
- Local-first architecture for development and experimentation
fantasy-api/
├── common/ # Shared data and configuration
├── src/ # Library and API implementation
├── update.py # Data update utilities
├── pyproject.toml # Project configuration
├── requirements.txt # Dependencies
└── setup.py # Package configuration
The project separates data collection from data consumption. External data is fetched and processed before being stored locally, allowing downstream applications to work against a consistent local dataset rather than repeatedly depending on external data sources.
- Python 3.10+
- uv or pip
Clone the repository:
git clone https://github.com/tesfayecf/fantasy-api.git
cd fantasy-apiInstall dependencies with uv:
uv syncOr install using pip:
pip install -r requirements.txtThe repository includes an update utility for fetching and refreshing the local dataset.
python update.pyThe update process retrieves the available fantasy football data and updates the local data used by the library and local API.
Reinforcement learning for fantasy football management.
https://github.com/tesfayecf/fantasy-rl
See the LICENSE file for license information.