pysmash
pysmash copied to clipboard
Access objects via id
I currently do not see a way to get the data of any api object based on their id other than tournaments. It would be good to have something like this:
api-object = smash.show_api-object-type(api-object-id)
that returns a dict with the matching data. Alternatively something like this would work as well:
anything = smash.show(anything-id, anything-object-type)
Hey @LuNoX, Just curious... What api objects are you specifically trying to grab and why? My initial desire for the wrapper was to completely avoid/circumvent making calls that mimic smash.gg's developer api, since then there would be no difference from using pysmash and just hitting their api directly. Would this/these methods just be a convenience? I thought I had extracted most pertinent information one could want from their endpoints while filtering out all of the useless (useless IMO) stuff that bloat their api responses. Getting a raw phase object, for instance, strikes me an unnecessary (but I also do not know what project you are using pysmash for)
Sets mostly. I am writing a Discord bot that notifies you once you're next match is up. That's why I need to update set information constantly, so I can check wether or not a new set needs to be played.
And yes it would be a convenience becausd I just learned python and I dont (yet) know how do something like this (in a not bad way).
AH. Very cool! Keep in mind that it is probably a bad idea to ever update something "constantly" as that would involve hammering smash.gg's API with requests. I will try to find some time this weekend to implement this thought.
I meant 'constantly' as in 'every time I type !matchups'. So don't worry about me making too many unnecessary api calls :)
P.S. I hate not being able to edit these comments cause it's early in the morning for me and I'm typing like shit
No worries :)
Sooooo, is this more difficult to implement than you thought or did you just not get around to doing it?
Unfortunately I just haven't gotten around to doing it. I'm under a bit of a deadline for another project I'm working on so this specific functionality isn't a super high priority for me. I do encourage you to Fork the repo and open a PR though :)
Ok, I'll just wait though. I've got other projects to work on in the meantime.
Peter Wensel [email protected] schrieb am Sa., 10. Dez. 2016 um 17:13 Uhr:
Unfortunately I just haven't gotten around to doing it. I'm under a bit of a deadline for another project I'm working on so this specific functionality isn't a super high priority for me. I do encourage you to Fork the repo and open a PR though :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PeterCat12/pysmash/issues/30#issuecomment-266219085, or mute the thread https://github.com/notifications/unsubscribe-auth/AVGSlOKVVC5taDRM4k4r6VVSCLbmRxvfks5rGs-rgaJpZM4K74hK .
I forked the project and did a shitty version of a set_show method. Would be nice if you merged it or implemented a non-shitty version of it yourself, so that I don't have to every time you update the repo.
I also implemented a very basic version of the show_me_any_type_of_object method
open a PR and I'll take a look!
done
For future reference, you should never have to rewrite your code every time in your fork. All you need to do is merge this master down into your fork and resolve any merge conflicts. And in your project just pip install from your fork.
Thanks, as you can tell still kinda new to git.
no worries man :)
@PeterCat12 this issue should be closed, no?