ethanluoyc / statsnba-playbyplay

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

Request: Add Referees to matchups #4

Closed mpw5421 closed 7 years ago

mpw5421 commented 7 years ago

I realize this is asking a lot considering you're providing all of this for free, but I was wondering if you might be able to add referees to the matchup groups in the program. In the NBA.com playbyplay it has the referee's name in parenthesis when fouls are called (i.e. Noah OFF.Foul (P1) (B.Kennedy) indicates referee Billy Kennedy made the foul call). So if you step through the events in the game until you find 3 unique referee names then you would know all of the referees to include in each matchup since referees don't sub out of the game. I guess there are instances where a referee is injured during a game and may not finish the game, but that is pretty rare and not something that would be easily detectable by parsing the play by play. Since if a ref's name stops showing up in the play by play you don't know if he was injured or he just didn't call any more fouls the rest of the game.

mpw5421 commented 7 years ago

Don't worry about this one. I figured out how to add it myself. It wasn't that hard since the referees are part of the boxscoresummaryv2 json feed going back several years. They're only in the play by play the last two years so the boxscoresummary is the better way to handle it to get the most data. So I just added an Officials function to the Game object which returns a list of the officials who worked that game.