API for Urban Rivals collection management
Project description
A module to support reading player purchase history data and storing it in a database.
- Basic Use:
Import api from urcollectionmanager
Create a request.Session and pass it, along with your credentials to session_connect_to_ur
Pass that same session (now authenticated) to get_purchase_history along with the number of pages to scrape.
Pass the result to convert_purchase_history
Optionally: Pass result to your own HTML parser.
You now have a list of Purchase objects that contain all relevant information available from the purchase history page.
- Database Use:
Run connect_and_initialize_database if you have a particular database location you want to connect to. By default this will connect to data/collection.sqlite
Pass a list of Purchase objects to write_history_to_database
Once the database has Purchase objects in it, you can run get_history_from_database to retrieve them.
Dev
- How To Use Tools:
- Poetry
To run the project (preferably configure venv first)
>>> poetry install
To configure your venv
>>> python -m venv /path/to/new/virtual/environment >>> poetry env info
If env info does not match your path, try manually running Scripts/activate inside that environment
To add a dependency (add a -D if it’s only for development)
>>> poetry add <dependency>
- Commitizen
>>> git add >>> cz c
More options can be found under options under Commitizen
- PreCommit
Update .pre-commit-config.yaml, then run
>>> pre-commit install >>> pre-commit run --all-files
More hook plugins can be found at PreCommitHooks
TODO:
Use UR-API to collect player data. UR-API-Example
Default to file output (excel or some form of that)
Testing (pytest, Coverage-py)
Documentation (Sphinx)
Not Required at this Time:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for urcollectionmanager-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 898a8464ebb77dfce43ee949ee54be45380e65c834b2ddc873bd74d4ddee0d1f |
|
MD5 | 55ca766f8f49efd270ec2e73828a36b5 |
|
BLAKE2b-256 | e02d23b23a9e0a8391ea16b0359e2eb5d188e43c7a64e95a2d947b14aa82ff2f |
Hashes for urcollectionmanager-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1ee326acedcc6bdf148724197beb22dafc5d17bcb958b1b84f964066ba76e67 |
|
MD5 | 27d3b58031bc89459f28079917c2c4d3 |
|
BLAKE2b-256 | 8b5926a16731d64a58057855d6325eaaaca878ab294eeae4a8aea224d0357309 |