Registry / analytics / nfl-data-py

nfl-data-py

JSON →
library0.3.3pypypiunverified

Python library for interacting with NFL play-by-play, player stats, and fantasy data sourced from nflfastR. Version 0.3.3 supports Python >=3.6.0, provides cached CSV imports to avoid redundant downloads, and is released irregularly on PyPI.

pip install nfl-data-py
INSTALL
IMPORT
SIG · NFL-DATA-PY
N
nfl-data-py
analyticspythonv0.3.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nfl_data_py
import nfl_data_py as nfl
from nfl_data_py import nfl_data_py
The library is imported as a module; using 'from' leads to AttributeError.

Downloads cached NFL play-by-play and weekly data for given seasons. Data is pulled from nflfastR's GitHub releases.

import nfl_data_py as nfl # Download play-by-play data for 2022 season df = nfl.import_pbp_data([2022]) print(df.head()) # Download weekly stats for 2021-2022 weekly = nfl.import_weekly_data([2021, 2022], columns=['player_id', 'player_name', 'fantasy_points']) print(weekly.head())
Debug
Known issues
deprecatedFunction `import_seasonal_data` is deprecated in 0.3.x. Use `import_weekly_data` or `import_pbp_data` instead.
fix
Replace `nfl.import_seasonal_data(years)` with `nfl.import_weekly_data(years) if you want player-level weekly stats, or `nfl.import_pbp_data(years)` for play-by-play.
affects: >=0.3.0
gotchaData is cached locally in `~/.cache/nfl_data_py`. If you delete the cache or get stale data, use `nfl.clean_cache()` or delete the directory manually.
fix
Run `import nfl_data_py as nfl; nfl.clean_cache()` to clear cache before re-downloading.
affects: all
gotchaSome functions like `import_weekly_data` accept a `columns` parameter to subset columns, but not all functions support it. Check the docstring for each function.
fix
Before using `columns` argument, verify it is listed in the function signature (e.g., `help(nfl.import_weekly_data)`).
affects: all
Upgrade
Version history
0.3.3latest on PyPI · released Sep 20, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
32
Amazon
1
OpenAI (training)
1
Resources
nfl-data-py — pip install nfl-data-py · libregistry