Programming Usage Stats Python Wrapper

Hello!

Many many moons ago, I started working on a usage stats API (since kind of moved away from that, it still exists but its not so much alive anymore because I cant afford to host it and the code needs a lot of work). I used this as the basis for my master's degree final project, https://github.com/Stu-Gotz/pgmp found here. Theres a lot of other bullshit in there, all the data collection is in the python folder in that repository. I decided to refactor it A LOT and it kind of organically evolved into a python wrapper, and still has some functions for ingesting data to a database (but I decided to keep a rolling three month count because anything older than that is kind of irrelevant). It is available through pip install and located here https://pypi.org/project/smog-usage-stats/.

The purpose of this post is both to bring awareness to it, I made it for you guys! and to also make an appeal for help. I don't really know how to test, I have a rough idea of how to set it up, but as far as robust testing, it's not something I'm familiar with. The way it has to be imported is annoying (`import smog_usage_stats.<module_name>`) and then you have access to the classes. Not the worst thing, but personally I dislike it and would rather just import it like: `import smog_usage_stats as smog`, then `smog.Class()` to instantiate, but this is my first 'real' python library ive ever made. I also need to update the readme in the github and PyPI repo, so sorry its really shitty.

There's really only two modules that should be widely used, the UsageStatsLookup, which returns a 2-D array of all usage stats data for whatever time and tier you are interested (eg March 2023 Gen 9 OU) and IndividualStatsLookup which returns a dict object of ONE (1) specific pokemon from the /chaos/ branch of usage statistics for a certain time and tier. (eg: Scizor's stats from March 2023 Gen 9 OU).

Please please please, if you are interested in aiding in anyway, fork it, do what you want and submit a PR. if you have questions, do not hesitate to reach out (I rarely log on here these days, you can contact through github if im taking ages, but I will try to check in here at least once a week for a while). If there are any bugs you encounter (which im sure you will) please make a github issue so I can track them easier on then and chase them down.

Thank you, have a nice day and hope you enjoy this. :)

edit: also Im not a programming wizard, if anyone sees anything thats not good please feel free to dm me about it. happy to collaborate :)
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top