Closed ryanpate closed 1 year ago
Receive the following error when using: game = mlb. get_game('game_id')
live_game = mlb.get_game(game_id).livedata ^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/mlb_api.py", line 907, in get_game return Game(mlb_data.data) ^^^^^^^^^^^^^^^^^^^^^ File "", line 8, in init File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/game.py", line 43, in __post_init__ self.gamedata = GameData(self.gamedata) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 20, in init File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/gamedata/gamedata.py", line 80, in post_init self.venue = Venue(**self.venue) ^^^^^^^^^^^^^^^^^^^ File "", line 11, in init File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/venues/venue.py", line 39, in post_init self.location = Location(self.location) if self.location else self.location ^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Location.init() got an unexpected keyword argument 'azimuthangle' ryanpate@Ryans-MacBook-Pro desktop % sudo python3 mlb2.py Chicago Cubs @ Miami Marlins Traceback (most recent call last): File "/Users/ryanpate/Desktop/mlb2.py", line 32, in live_game = mlb.get_get_livedata(game_id) ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Mlb' object has no attribute 'get_get_livedata' ryanpate@Ryans-MacBook-Pro desktop % sudo python3 mlb2.py Chicago Cubs @ Miami Marlins Traceback (most recent call last): File "/Users/ryanpate/Desktop/mlb2.py", line 32, in live_game = mlb.get_livedata(game_id) ^^^^^^^^^^^^^^^^ AttributeError: 'Mlb' object has no attribute 'get_livedata' ryanpate@Ryans-MacBook-Pro desktop % sudo python3 mlb2.py Chicago Cubs @ Miami Marlins Traceback (most recent call last): File "/Users/ryanpate/Desktop/mlb2.py", line 32, in live_game = mlb.get_game(game_id) ^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/mlb_api.py", line 907, in get_game return Game(mlb_data.data) ^^^^^^^^^^^^^^^^^^^^^ File "", line 8, in init File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/game.py", line 43, in post_init self.gamedata = GameData(**self.gamedata) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 20, in init File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/gamedata/gamedata.py", line 80, in post_init self.venue = Venue(self.venue) ^^^^^^^^^^^^^^^^^^^ File "", line 11, in init File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/venues/venue.py", line 39, in __post_init__ self.location = Location(self.location) if self.location else self.location ^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Location.init() got an unexpected keyword argument 'azimuthangle'
Looks like the MLB has added a couple of new attributes. I'll have this fixed for you shortly.
This has been fixed @ryanpate
Thanks! This is a great library!
Receive the following error when using: game = mlb. get_game('game_id')
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/mlb_api.py", line 907, in get_game return Game(mlb_data.data) ^^^^^^^^^^^^^^^^^^^^^ File "", line 8, in init
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/game.py", line 43, in __post_init__
self.gamedata = GameData( self.gamedata)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 20, in init
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/gamedata/gamedata.py", line 80, in post_init
self.venue = Venue(**self.venue)
^^^^^^^^^^^^^^^^^^^
File "", line 11, in init
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/venues/venue.py", line 39, in post_init
self.location = Location(self.location) if self.location else self.location
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Location.init() got an unexpected keyword argument 'azimuthangle'
ryanpate@Ryans-MacBook-Pro desktop % sudo python3 mlb2.py
Chicago Cubs @ Miami Marlins
Traceback (most recent call last):
File "/Users/ryanpate/Desktop/mlb2.py", line 32, in
live_game = mlb.get_get_livedata(game_id)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Mlb' object has no attribute 'get_get_livedata'
ryanpate@Ryans-MacBook-Pro desktop % sudo python3 mlb2.py
Chicago Cubs @ Miami Marlins
Traceback (most recent call last):
File "/Users/ryanpate/Desktop/mlb2.py", line 32, in
live_game = mlb.get_livedata(game_id)
^^^^^^^^^^^^^^^^
AttributeError: 'Mlb' object has no attribute 'get_livedata'
ryanpate@Ryans-MacBook-Pro desktop % sudo python3 mlb2.py
Chicago Cubs @ Miami Marlins
Traceback (most recent call last):
File "/Users/ryanpate/Desktop/mlb2.py", line 32, in
live_game = mlb.get_game(game_id)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/mlb_api.py", line 907, in get_game
return Game( mlb_data.data)
^^^^^^^^^^^^^^^^^^^^^
File "", line 8, in init
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/game.py", line 43, in post_init
self.gamedata = GameData(**self.gamedata)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 20, in init
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/game/gamedata/gamedata.py", line 80, in post_init
self.venue = Venue(self.venue)
^^^^^^^^^^^^^^^^^^^
File "", line 11, in init
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mlbstatsapi/models/venues/venue.py", line 39, in __post_init__
self.location = Location( self.location) if self.location else self.location
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Location.init() got an unexpected keyword argument 'azimuthangle'