Page 1 of 1

Script for PBP w/ Lineups

Posted: Sat Jun 10, 2017 3:01 pm
by italia13calcio
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.

Re: Script for PBP w/ Lineups

Posted: Sat Jun 10, 2017 4:45 pm
by jgoldstein34
This is much appreciated, thank you for sharing!

Re: Script for PBP w/ Lineups

Posted: Tue Jun 13, 2017 1:39 am
by shadow
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.

Re: Script for PBP w/ Lineups

Posted: Tue Jun 13, 2017 4:16 pm
by DSMok1

Re: Script for PBP w/ Lineups

Posted: Tue Jun 13, 2017 4:54 pm
by shadow
Cool, thanks.