Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Module nfldb provides command line tools and a library for maintaining and querying a relational database of play-by-play NFL data. The data is imported from nflgame, which in turn gets its data from a JSON feed on NFL.com’s live GameCenter pages. This data includes, but is not limited to, game schedules, scores, rosters and play-by-play data for every preseason, regular season and postseason game dating back to 2009.

Here is a small teaser that shows how to use nfldb to find the top five passers in the 2012 regular season:

#!python
import nfldb

db = nfldb.connect()
q = nfldb.Query(db)

q.game(season_year=2012, season_type='Regular')
for pp in q.sort('passing_yds').limit(5).as_aggregate():
    print ( pp.player, pp.passing_yds)

And the output is:

[andrew@Liger ~] python2 top-five.py
Drew Brees (NO, QB) 5177
Matthew Stafford (DET, QB) 4965
Tony Romo (DAL, QB) 4903
Tom Brady (NE, QB) 4799
Matt Ryan (ATL, QB) 4719

In theory, both nfldb and nflgame provide access to the same data. The difference is in the execution. In order to search data in nflgame, a large JSON file needs to be read from disk and loaded into Python data structures for each game. Conversely, nfldb’s data is stored in a relational database, which can be searched and retrieved faster than nflgame by a few orders of magnitude. Moreover, the relational organization of data in nfldb allows for a convenient query interface to search NFL play data.

The database can be updated with real time data from active games by running the nfldb-update script included with this module as often as you’re comfortable pinging NFL.com. (N.B. The JSON data itself only updates every 15 seconds, so running nfldb-update faster than that would be wasteful.) Roster updates are done automatically at a minimum interval of 12 hours.

nfldb has comprehensive API documentation and a wiki with examples.

nfldb can be used in conjunction with nflvid to search and watch NFL game footage.

Please join us in discord https://discord.gg/G7uay2

Metadata

Release files for nfldb-redux 1.0.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nfldb-redux 1.0.0a4
File Size Uploaded Provenance Actions
nfldb-redux-1.0.0a4.tar.gz 230.1 kB Without provenance Details for nfldb-redux-1.0.0a4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nfldb-redux 1.0.0a4
File Interpreter ABI Platform Actions
nfldb_redux-1.0.0a4-py3-none-any.whl Python 3 none any Details for nfldb_redux-1.0.0a4-py3-none-any.whl

Total release size: 476.9 kB

Release files / nfldb-redux-1.0.0a4.tar.gz

Download URL nfldb-redux-1.0.0a4.tar.gz
Size 230.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aed21b02fbaba1550d36e6165948dae028aa59d74597e58af916ab71ceaadccc
BLAKE2b-256 checksum
How to use checksums
1594c8d43e60881bd515f6533d6d80caf10d1ed6234681bdfc8f4d7b54b58589
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.7

Release files / nfldb_redux-1.0.0a4-py3-none-any.whl

Download URL nfldb_redux-1.0.0a4-py3-none-any.whl
Size 246.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db03f989c8eed426921fbf8c94232a8a7de787c56a8d8a4bb93cc94d6388d2bf
BLAKE2b-256 checksum
How to use checksums
383e5828c9a8172bb11ef0ccc0ff123f71eb8108366b7d7f51a31b26b48baef0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.7

Security for nfldb-redux 1.0.0a4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page