Python code for working with NFL play by play data
nfl_data_py
nfl_data_py is a Python library for interacting with NFL data sourced from nflfastR (https://github.com/nflverse/nflfastR-data/) and nfldata (https://github.com/nflverse/nfldata/).
Installation
Use the package manager pip to install nfl_data_py.
pip install nfl_data_py
Usage
import nfl_data_py as nfl
Working with play-by-play data
nfl.import_pbp_data(years, columns)
Returns play-by-play data for the years and columns specified
years : required, list of years to pull data for (earliest available is 1999)
columns : optional, list of columns to pull data for
nfl.see_pbp_cols()
returns list of columns available in play-by-play dataset
Working with weekly data
nfl.import_weekly_data(years, columns)
Returns weekly data for the years and columns specified
years : required, list of years to pull data for (earliest available is 1999)
columns : optional, list of