Closed rk92080 closed 5 years ago
It looks like you are still using the old package. I have updated box_scores in the newest package to pass a filter to the API instead of checking the scoringPeriod myself.
Thaknks fot the response. Reinstalled, now im getting another error:
File "C:/Users/rkuma343/Documents/Python_Scripts/Fantasy/take12.py", line 63, in matchup box=league.box_scores(i)
File "C:\Users\rkuma343\Documents\Anaconda\lib\site-packages\ff_espn_api\league.py", line 313, in box_scores box_data = [BoxScore(matchup) for matchup in schedule]
File "C:\Users\rkuma343\Documents\Anaconda\lib\site-packages\ff_espn_api\league.py", line 313, in
File "C:\Users\rkuma343\Documents\Anaconda\lib\site-packages\ff_espn_api\box_score.py", line 7, in init self.home_score = round(data['home']['rosterForCurrentScoringPeriod']['appliedStatTotal'], 2)
KeyError: 'rosterForCurrentScoringPeriod'
What is the value of “i” when you pass it into box_scores? I have found if you go past the current week it will not have the data. I need to add error checking for that so it doesn’t crash.
Hey, sorry for the late resposne... looks like i resolved the issue..
No problem! I am actually going to reopen it so I don’t forget to add error checking if the week passed in is greater than current week.
Tryint to pull box score:
And getting the following Error:
File "C:/Users/rkuma343/Documents/Python_Scripts/Fantasy/take12.py", line 85, in players_matchup bs=(league.box_scores(1))
File "C:\Users\rkuma343\Documents\Anaconda\lib\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 "C:\Users\rkuma343\Documents\Anaconda\lib\site-packages\ff_espn_api\league.py", line 309, in
box_data = [BoxScore(matchup) for matchup in schedule if str(week) in matchup['home']['pointsByScoringPeriod']]
KeyError: 'pointsByScoringPeriod'