Skip to main content

python library for interacting with NFL data sourced from nflfastR

Project description

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 columns to pull data for

nfl.see_weekly_cols()

returns list of columns available in weekly dataset

Working with seasonal data

nfl.import_seasonal_data(years)

Returns seasonal data, including various calculated market share stats

years : required, list of years to pull data for (earliest available is 1999)

Importing roster data

nfl.import_rosters(years, columns)

Returns roster information for 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

Other assorted data imports

nfl.import_win_totals(years)

Returns win total lines for years specified years : optional, list of years to pull

nfl.import_sc_lines(years)

Returns scoring lines for years specified years : optional, list of years to pull

nfl.import_officials(years)

Returns official information by game for the years specified years : optional, list of years to pull

nfl.import_draft_picks()

Returns list of draft picks for the years specified years : optional, list of years to pull

nfl.import_draft_values()

Returns relative values by generic draft pick according to various popular valuation methods

Additional features

nfl.clean_nfl_data(df)

Runs descriptive data (team name, player name, etc.) through various cleaning processes

df : required, dataframe to be cleaned

Recognition

I'd like to recognize all of Ben Baldwin, Sebastian Carl, and Lee Sharpe for making this data freely available and easy to access. I'd also like to thank Tan Ho, who has been an invaluable resource as I've worked through this project, and Josh Kazan for the resources and assistance he's provided.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

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_py-0.1.6.tar.gz (8.7 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_py-0.1.6-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nfl_data_py-0.1.6.tar.gz.

File metadata

  • Download URL: nfl_data_py-0.1.6.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for nfl_data_py-0.1.6.tar.gz
Algorithm Hash digest
SHA256 9a472f6ee13521360b5cdf97afe3c94e479319d360bd2cfd1a7f4644e3615e15
MD5 d680b41a33105e4b6c4ab98423125c75
BLAKE2b-256 8945c21b63cf7d20001b04ea3cd110df3929870d7970293b8a47b5eb8ff321da

See more details on using hashes here.

File details

Details for the file nfl_data_py-0.1.6-py2.py3-none-any.whl.

File metadata

  • Download URL: nfl_data_py-0.1.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for nfl_data_py-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ab1024c2e819e1072940d2bc58e3d2a92b46e53662863578390665ec71119648
MD5 ad9cb9f3ffc0c8e833937297dfc513f4
BLAKE2b-256 98371f12713bbd37f7ab7946836a5dcc8f5d85db4bd970ba304d1d792bb0ad52

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