NOTE: This project is still pretty much work in progress so it might introduce many breaking changes.
Introduction
Basketball analytics using play-by-play data have been an shared interest for many people. However, the lack of processed play-by-play has prohibited such analysis by many.
This project is intended to provide parsing functionality for the play-by-play data from http://stats.nba.com into more a comprehensive format like that on NBAStuffer. It is intended to accompany our research: Adversarial Synergy Graph Model for Predicting Game Outcomes in Human Basketball. to prepare the data. If you are interested in more general statistics or player information, you should definitely check out py-Goldsberry.
While there are still limitations with the current parsing strategy, it does not affect the tabulation of APM and other play-by-play based metrics.
Use the data
If you just want to use the data that is processed with the package without touching it, you can find a copy of the data from S3. Under data/zip/ you will find the gamelog and game files in JSON format. You may introspect into the JSONs for the fields that are included in them.
Benefits of this package
The data is obtained directly from http://stats.nba.com, the parsed play-by-plays can be verified against the official boxscores.
Installation
At the command line
$ pip install statsnba-playbyplay
TODOs
Documentation.
Parse subtypes of events. (e.g. when there is a shot, is it a layup or jumpshot? the raw data provides different codes for these subtypes but I have not yet figured out a way to easily decrypt all of them.)
More tests at all levels of the package.
A Github Pages website for showcasing the package.
Wiki pages on the schema of the parsed data on my S3 bucket.
Daily updates of the data feed (cronjob or Lambda function on an EC2 instance to track the gamelogs daily and make updates on S3?)
Metadata
Release files for statsnba-playbyplay 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| statsnba-playbyplay-0.3.0.tar.gz | 413.2 kB | Without provenance | Details |
Release files / statsnba-playbyplay-0.3.0.tar.gz
| Download URL | statsnba-playbyplay-0.3.0.tar.gz |
|---|---|
| Size | 413.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3381d4c6a8f634aff84e1995bdbb2e81b59efb6d1f54082f15ff3bef7b3c927
|
|
BLAKE2b-256 checksum How to use checksums |
5fbdd2e0866cd6f627c943a3382d2787aefec1e41788c5e5d68a05e4d4988ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for statsnba-playbyplay 0.3.0
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.