ethanluoyc / statsnba-playbyplay

Parsing play-by-play data from stats.nba.com
MIT License
48 stars 12 forks source link

=================== statsnba-playbyplay

.. image:: https://img.shields.io/pypi/v/statsnba-playbyplay.svg?maxAge=2592000 :target: https://pypi.python.org/pypi?name=statsnba-playbyplay&version=0.1.0&:action=display :alt: PyPi Version

.. image:: https://readthedocs.org/projects/statsnba-playbyplay/badge/?version=latest :target: http://statsnba-playbyplay.readthedocs.io/en/latest/?badge=latest :alt: 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 <https://downloads.nbastuffer.com/nba-play-by-play-data-sets>. It is intended to accompany our research: Adversarial Synergy Graph Model for Predicting Game Outcomes in Human Basketball <http://www.somchaya.org/papers/2015_ALA_Liemhetcharat.pdf>. to prepare the data. If you are interested in more general statistics or player information, you should definitely check out py-Goldsberry <https://github.com/bradleyfay/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 here <https://www.doc.ic.ac.uk/~yl11416/statsnba-data/>__. You will find the gamelog and game files in JSON format. You may inspect the JSON for the fields that are included in them.

Benefits of this package

Installation

At the command line

.. code:: shell

$ pip install statsnba-playbyplay

TODOs