I have seen a few threads talking about scraping play-by-play with lineups, for use in calculating APM derivatives. I created a script last year for doing so from stats.nba.com, and have uploaded it to GitHub.
https://github.com/hwchase17/Play-By-Pl ... th-Lineups
This gets all PBP w/ lineups for the 2016-17 season (changing season is trivial) and saves it to a .csv file.
It works successfully for the past two seasons, but I haven't tested it out on any others. I don't imagine there should be any errors, please let me know - best way is on Twitter @aabsblog as I don't check this forum that often.
Script for PBP w/ Lineups
-
- Posts: 100
- Joined: Sun Dec 08, 2013 2:54 am
-
- Posts: 249
- Joined: Fri Sep 30, 2016 6:38 pm
Re: Script for PBP w/ Lineups
This is much appreciated, thank you for sharing!
Re: Script for PBP w/ Lineups
Does anyone have a script to create aggregated matchup files (similar to what used to be available at basketball value) from the csv generated by this script? I suppose this would involve calculating the number of possessions and scoring margin for each matchup stint. Here is a link to the output for 2016-17:
https://www.dropbox.com/sh/3gj9jpcpeo75 ... ?dl=0&lst=
I can continue creating the pbp for previous years and post them to the dropbox folder linked above if anyone is interested.
https://www.dropbox.com/sh/3gj9jpcpeo75 ... ?dl=0&lst=
I can continue creating the pbp for previous years and post them to the dropbox folder linked above if anyone is interested.
Re: Script for PBP w/ Lineups
Take a look at this package: https://github.com/ethanluoyc/statsnba-playbyplay