Skip to main content

Package for parsing play-by-play data from stats.nba.com

Project description

PyPi Version Documentation Status

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?)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

statsnba_playbyplay-0.1.0-py2-none-any.whl (10.7 kB view details)

Uploaded Python 2

File details

Details for the file statsnba_playbyplay-0.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for statsnba_playbyplay-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 528b7c66b448f1ff93107d796711a51bb1b82a014c7cce883121fbb512b003d2
MD5 0a870475b025112a21612cbcf6c96f37
BLAKE2b-256 7aaec318e5df98181bf8c41926bec0ae36ca5555e8cae5a78dbf131232fa5ad0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page