Skip to main content

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

  • espn-api-orm (PyPi Package)
    • Team Data trigger

    • Venue Data trigger

    • Event Data trigger

    • odds-data-pump (TBD)

    • Fantasy Data trigger

  • nfl-madden-data (Manual Yearly Trigger)
  • ELO-Rating Data trigger

Downstream

  • Feature Store Data trigger
  • nfl-model-store (TBD)
  • nfl-madden-data (Manual Yearly Trigger)

๐Ÿš€ 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

๐Ÿ—๏ธ 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

  1. Load: Pull raw data from any source (e.g., ESPN, nflverse) or pull cached feature store (Event, Player)
  2. Transform: Apply rolling averages, imputation, feature engineering
  3. 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.yml for 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)

  1. python -m build

  2. twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nfl_data_loader-0.0.8.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nfl_data_loader-0.0.8-py3-none-any.whl (95.7 kB view details)

Uploaded Python 3

File details

Details for the file nfl_data_loader-0.0.8.tar.gz.

File metadata

  • Download URL: nfl_data_loader-0.0.8.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.5

File hashes

Hashes for nfl_data_loader-0.0.8.tar.gz
Algorithm Hash digest
SHA256 0b963a0eb02fd2bb0e84f37870049779b5464675f64a09fde3f3e2e7be644d0a
MD5 0841bc42c5f68ce89859ebf24205ea53
BLAKE2b-256 e5a814fca469af01589a610dd1e363f27fd904e1d249985a921310bbe6679dab

See more details on using hashes here.

File details

Details for the file nfl_data_loader-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for nfl_data_loader-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7e7b2911260303efab5e055e4fa6c21c041deb1922a945861c3c66065a10526d
MD5 46b79ae9d01ff163cf432c4f887cd563
BLAKE2b-256 728286f4d1cd5d2e89b0cd9e92aed6696445e4e77eaa1d8d3bf26ae42d3ee276

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page