BurntSushi / nflgame

An API to retrieve and read NFL Game Center JSON data. It can work with real-time data, which can be used for fantasy football.
http://pdoc.burntsushi.net/nflgame
The Unlicense
1.27k stars 412 forks source link

Can't read from 2017 games #335

Closed stermi01 closed 6 years ago

stermi01 commented 6 years ago

After managing to set my schedule up for 2017 games, I'm still having trouble reading 2017 regular season games. Getting the following error, just trying to get basic info that you had from issue #331 :

I updated nflgame and made sure to update the schedule as well as switch it back. Any idea?

Code:

import nflgame import csv

games = nflgame.games(2017) print len(games)

Error:

TypeError Traceback (most recent call last)

in () 2 import csv 3 ----> 4 games = nflgame.games(2017) 5 print len(games) C:\Program Files\Anaconda2\lib\site-packages\nflgame\__init__.pyc in games(year, week, home, away, kind, started) 227 (as opposed to waiting for a 404 error from NFL.com). 228 """ --> 229 return list(games_gen(year, week, home, away, kind, started)) 230 231 TypeError: 'NoneType' object is not iterable
stermi01 commented 6 years ago

had to add the following to the statement

games = nflgame.games(2017, kind = 'REG')

ochawkeye commented 6 years ago

Not sure why that would do anything different for you...'REG' is the default value for kind. https://github.com/BurntSushi/nflgame/blob/master/nflgame/__init__.py#L192

stermi01 commented 6 years ago

I'm not sure, It was something that ended up happening last year where I had trouble getting individual postseason games and since then I've had some problems, but that seemed to be the solution that worked.