cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
546 stars 183 forks source link

KeyError: 'pointsByScoringPeriod' #26

Closed cdgarren closed 4 years ago

cdgarren commented 4 years ago

I'm running into the following error when using the League.box_scores function for 2019 Week 1:

  File "/home/cdgarren/Projects/fantasyfootball/env/lib/python3.5/site-packages/ff_espn_api/league.py", line 309, in box_scores
    box_data = [BoxScore(matchup) for matchup in schedule if str(week) in matchup['home']['pointsByScoringPeriod']]
  File "/home/cdgarren/Projects/fantasyfootball/env/lib/python3.5/site-packages/ff_espn_api/league.py", line 309, in <listcomp>
    box_data = [BoxScore(matchup) for matchup in schedule if str(week) in matchup['home']['pointsByScoringPeriod']]
KeyError: 'pointsByScoringPeriod'

I'm working on migrating my homebrew scripts to use your module, and I was able to recreate what I needed while testing with the 2018 season. This occurs when I switch to 2019. So I'm not sure if this is stemming from an API change, or if this is due to the fact that the games for the Week 1 haven't started yet.

cwendt94 commented 4 years ago

I recently updated the package to fix this error. Try updating and let me know if it is fixed!

cdgarren commented 4 years ago

That did fix it. Thanks!