This is a Python package for easily loading NFL play by play data via nflfastR
nflfastpy is available on PyPI
$ pip install nflfastpy
nflfastpy supports Python 3.6+
Play by play data is available going back to 1999.
import nflfastpy
df = nflfastpy.load_pbp_data(year=2020)
Roster data comes with player headshots. Rookies are not included in roster data as roster data is only available up to 2019. To account for this, a variable is available in the module called nflfastpy.default_headshot
that is a numpy array representation of a default player headshot.
roster_df = nflfastpy.load_roster_data()
To join roster data with play by play data, player id's in the play by play data must be converted to the old GSIS ID. The helper function in nflfastpy.utils.convert_to_gsis_id
accomplishes this. Check out the file named "Roster Data and Team Logo Data.ipynb" under the examples folder to see how to use the function.
Schedule data is available from 1999 to 2020.
schedule = nflfastpy.load_schedule_data(year=2020)