roclark / sportsipy

A free sports API written for python
MIT License
475 stars 189 forks source link

'None' type being returned from valid Boxscore URI instantiation #789

Closed jack11wagner closed 7 months ago

jack11wagner commented 7 months ago

Describe the bug Trying to get data for a Boxscore (I have tried multiple valid URI id's for NBA games

To Reproduce

!pip install git+https://github.com/davidjkrause/sportsipy@master
import sportsipy
from sportsipy.nba.boxscore import Boxscore

game_str = "201806080CLE"
boxscore = Boxscore(game_str)

Expected behavior I would expect a valid Boxscore object to be returned.

Screenshots

image
davidjkrause commented 7 months ago

Appears to be a setup or environment issue, as this is working for me. Output:

>>> import sportsipy
>>> from sportsipy.nba.boxscore import Boxscore
>>> game_str = "201806080CLE"
>>> boxscore = Boxscore(game_str)
>>> boxscore.away_players
[<sportsipy.nba.boxscore.BoxscorePlayer object at 0x7feab07386a0>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea88087f40>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880ea500>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9c90>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9e70>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9ea0>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9d80>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9db0>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9c30>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9de0>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9f60>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880ea020>, <sportsipy.nba.boxscore.BoxscorePlayer object at 0x7fea880e9e40>]

One other person who was trying to use the fork ran into an issue where they had already installed sportsipy from pip, and then installed the fork afterwards, which causes issues.

jack11wagner commented 7 months ago

I did that as well. This error seems to be resolved now, as its working consistently.