Metadata-Version: 2.1
Name: smog_usage_stats
Version: 1.0.0
Author-email: "stu.gotz.dev" <gotz.stu.dev@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Alan Nardo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: pokemon,usage,pokemon showdown,smogon
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4
Requires-Dist: pathlib
Requires-Dist: psycopg==3.1.12
Requires-Dist: psycopg-binary==3.1.12
Requires-Dist: psycopg2==2.9.5
Requires-Dist: python-dateutil
Requires-Dist: python-dotenv
Requires-Dist: requests
Requires-Dist: soupsieve
Requires-Dist: typing_extensions
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pip-tools; extra == "dev"
Requires-Dist: pytest; extra == "dev"

# smog_usage_stats

This is a bit of a pet project of mine that has been in the works for some while and
seen several iterations.

In short, it pulls usage stats from [smogon.com's stats
pages](https://smogon.com/stats) and turns them into a usable data. Originally, it
was a very functional solution, currently I am working to shift it to OOP and once
that's sorted, ship it as a package so other people can use it.

## Quick Rundown

### Installing:

Because its not a package yet, you will have to download this to somewhere on your
PC. Just download it the same way you normally copy code repositories from Git. Open
it in your favourite IDE or text editor and have fun.

### How it all works

`Search.py` is the uber parent searcher class, that all other searcher classes
inherit from. You shouldn't need to ever call this directly.

The four primary search classes are:

`BaseStatsSearch` -> searches the normal stats directory

`MonotypeStatsSearch` -> searches the monotype stats directory

`BaseChaosSearch` -> searches the chaos data contained within a certain months stats
data

`MonotypeChaosSearch` -> searches the monotype chaos data contained within a certain
months stats data

The latter two are more individual searches and there is also a (WIP)
`IndividualStatsSearch` class which will be used to search for individual usage stats
data from the Base or Monotype stats search classes.

`Validation.py` handles the validation of query parameters for the queries, making
sure everything is lined up to actually return data. The first instance of this
project had a very shotgun-blast approach which was massively ineffective and did not
account for discrepencies in labeling conventions used by Smogon in their earlier
days of stats collection. You also should never need to call this directly, it is
effectively a helper class.

`SQLInterface.py` does what it says on the tin, it allows interacting with a (in
this case) PostgreSQL database instance. I HIGHLY recomend using a .env file if you
use this in any way, and add it to your `.gitignore`.

`Update.py` is a class to push new data to the database. The SQL data serves as a
backend for a full-stack application I am working on as well, so it's probably not
necessary for this nor `SQLInterface.py` to be used for most cases, but it is there
if someone maybe wants to make a Mongo interface or anything else.

## Future plans:

- Finish up individual stats search
- Clean up directory to get rid of old data
- Test test test
- Write update function to work as a scheduled task

## Contributing:

If you find a bug, please make
an issue and then submit a pull request when it's sorted.

If you are interested in just using this on your own, feel free to copy and make
changes as you like, it's not owned by me, just a fun project. I'll add in licensing
stuff once I package it up, but it will always be open-source.
