-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Could not find a game with that id. #52
Comments
Hmm... That status should be "OTHER".
I think the problem is that it can't find |
Whoops sorry, that one also breaks. Here is the id I used: |
@Hisairnessag3 |
Gotcha, I appreciate your help here. I'd be open to helping you out with that in the future |
@panzarino Perhaps tag this for a v3 release. It would probably also be wise to just make use of the MLB stats API to access the boxscore and any of the other endpoints we have custom code for, rather than dealing with these URLs that may or may not continue to change. For example: https://statsapi.mlb.com/api/v1/schedule?sportId=1&date=05%2F16%2F2016 will give you the schedule for 05/16/2016 as a json payload. Each game has a The boxscore for that game is: https://statsapi.mlb.com/api/v1/game/447440/boxscore boxscore endpoint documentation: https://statsapi.mlb.com/docs/#!/game/boxscore |
Hmm still breaking here: |
That's some weird spring training game. The actual boxscore is here: http://gd-terr-origin.mlb.com/components/game/aax/year_2016/month_04/day_02/gid_2016_04_02_milmlb_blxaax_1/boxscore.xml and not under the expected game/mlb location. More logic would have to be added to read the scoreboard xml and get the |
@trevor-viljoen @Hisairnessag3 I don't really have much time to maintain this library myself, but I would really be open to PRs if you guys are interested in joining the project. |
I ran into this yesterday while trying to cycle through a list of games for a random day in 2017. It's probably worth logging a new issue for migrating over to the Stats API (if it's ready and supports all of mlbgame's current features) and bumping the major version as @trevor-viljoen suggested above. For now we could probably just return |
The boxscore location is information we currently have available ( |
@ajbowler I feel like returning |
@ajbowler So, there's a catch 22 here with retrieving the game data if the game isn't a common MLB team v MLB team game. You need the overview in order to get the |
@trevor-viljoen I would be good with upgrading to the new stats API, but I feel like now that there is an easy API this service is useless. I built it because it was difficult to parse the xml and organize it, but a json API greatly reduces the need for the middle man. |
It depends if the new API has all the existing data that this module needs. If it doesn't, then it ain't ready to migrate IMO but that's your call. If it does have everything, then I still find a huge value out of this module because it allows a nice abstraction away from hitting the API directly and allowing consumers to just stick to their program. As it is, this library is nice because it parses the XML files into nice and easy objects without discarding the data. If it moves to the new JSON API, the library could definitely be slimmed down in its implementation, but I still see the benefit of having a ready-to-go Python wrapper. |
@panzarino I agree with @ajbowler. This module still serves a purpose in the python community, wrapping the JSON API into python objects. It reduces unnecessary code and allows one to just import an easy to use python module which neatly handles all of the dirty work. I wouldn't want to write redundant code every time I wanted to go out and pull JSON from MLB. You've done really great work here. Tonight, I started work on wrapping the JSON API. If you want to open a Below is an example of some of the data returned by the
|
@trevor-viljoen do you have a link to their new API? I've been unable to find anything other than a StatsAPI login that doesn't give an option to register. |
@trevor-viljoen Great! I'll open the branch soon. |
@ajbowler Try this: https://statsapi.mlb.com/docs/#!/ |
@trevor-viljoen Thanks, that link works. The docs are really bare bones on there and this API looks really WIP at the moment, but if they flesh this out more then having a JSON API would be awesome. I tried something simple like the standings endpoint but can't figure it out. What the hell is a "league ID"? I've just added displaying MLB standings as a feature to my LED scoreboard. If that endpoint can be figured out, that might be one of the easier ones to start migrating over to. |
@ajbowler Check out the current |
@ajbowler division and league IDs can be found here: https://github.com/panzarino/mlbgame/blob/master/mlbgame/info.py#L192-L219 I don't think the standings API is hot yet though. Try schedule: https://statsapi.mlb.com/api/v1/schedule?sportId=1&season=2017&date=07%2F04%2F2017 |
Running the same code as before:
and its breaking on random game ids when iterating through.
This one in particular breaks:
Status is also
FINAL
The text was updated successfully, but these errors were encountered: