A Python interface for various NFL data sources
Project description
nfl-data-loader
nfl-data-loader is a robust Python package for accessing, merging, and transforming NFL sports data from multiple sources in an object-oriented, pipeline-friendly way. It provides a unified API for teams, players, events, and venues, with rich schema documentation and ready-to-use data loaders, transformers, and formatters.
TheEdgePredictor Services
Upstream
Downstream
๐ Features
- Unified access to NFL data from multiple sources (nflverse, Madden, Pro Football Reference, ESPN API)
- Modular loader, transform, and formatter architecture
- Pydantic schemas for all endpoints and data objects
- Grouped by:
team,player,event,venue - Easy integration into ML/data pipelines
- Auto-deploy to PyPI on merge to main (see CI/CD)
๐ฆ Data Sources
- feature-store
- Madden EA / madden.weebly
- Pro Football Reference
- ESPN API, fantasy-data-pump
- nflverse
- greerreNFL
๐๏ธ Architecture
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ Sources โโโ โ Formatters โโโ โ Workflows โ
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ โ โ
[team, player, event, venue] [Extract, Transform, Load Blocks and Pipelines]
๐งฉ Loader Groups
- Team: Team stats, rosters, schedules, advanced metrics
- Player: Player stats, depth charts, Madden ratings, combine data
- Event: Game-level stats, play-by-play, Vegas lines, EPA, fantasy
- Venue: Stadium/venue metadata and mappings
๐ Schemas & Data Dictionary
All endpoints return data validated by Pydantic schemas. See /schemas for:
- Field names, types, and descriptions (see
schemas/events/features.py,schemas/players/madden.py,schemas/players/position.py) - Example: Player Madden schema, event feature schema, position mappers
๐ ๏ธ Usage Example
from nfl_data_loader.api.sources.players.rosters.rosters import collect_roster
from nfl_data_loader.workflows.transforms.players.player import make_player_stats
# Load player roster for a season
roster_df = collect_roster(2024)
# Transform player stats
player_stats = make_player_stats(2024, week=1, position_group='quarterback')
๐ Data Flow Example
- Load: Pull raw data from any source (e.g., ESPN, nflverse) or pull cached feature store (Event, Player)
- Transform: Apply rolling averages, imputation, feature engineering
- Format: Output as DataFrame, JSON, or for ML pipelines
๐งช Testing & Validation
- All endpoints are covered by tests (see
/tests) - Schemas are validated with Pydantic
- Linting and type checking enabled
๐ค CI/CD & PyPI Deployment
- GitHub Actions workflow auto-deploys to PyPI on merge to
main - See
.github/workflows/publish.ymlfor details
๐ค Contributing
Pull requests welcome! Please add/expand tests and update schema docs for new endpoints.
For a full list of available endpoints, schemas, and data fields, see the /schemas and /api directories. For questions or issues, open a GitHub issue.
Publishing
Auto publish available through GitHub Actions and Pypi
Local publishing (include token in rc)
-
python -m build -
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nfl_data_loader-0.0.5.tar.gz.
File metadata
- Download URL: nfl_data_loader-0.0.5.tar.gz
- Upload date:
- Size: 73.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db24987fcfd7b800d1f02a0d7cf7cffaed91f0f44b59476e073f1f49b3ef9acb
|
|
| MD5 |
151e93976081028b854aa9d685f89351
|
|
| BLAKE2b-256 |
6383919421649242698dc958aae14a6ee2140afbbf59a63226e598a6100f8445
|
File details
Details for the file nfl_data_loader-0.0.5-py3-none-any.whl.
File metadata
- Download URL: nfl_data_loader-0.0.5-py3-none-any.whl
- Upload date:
- Size: 96.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9107850a07e9a278928c93367eb515dbc64b1d8c2790dfc92dbc19854ddcaed1
|
|
| MD5 |
433954a07b1db1320cdfa8945db685d1
|
|
| BLAKE2b-256 |
fa4d6aaf74a58f60dee2615f792c72739b3907856f4066b69a1cf0a0eb2580ef
|