Python API wrapper for Prosperous Universes community API FIO.
Project description
fio_wrapper - Prosperous Universe game data through FIO
FIO API wrapper with pydantic data validation and easy-to-use querying. fio_wrapper implements the most used endpoints of Prosperous Universes community game data API.
- Source Code: https://github.com/jplacht/fio_wrapper
- Documentation: https://jplacht.github.io/fio_wrapper/
- PyPi Package: https://pypi.org/project/fio-wrapper/
Usage
Installation
pip install fio-wrapper
Access data
Creating the FIO adapter and looking for information about the material Drinking Water by its ticker "DW".
from fio_wrapper import FIO
fio = FIO()
material = fio.Material.get("DW")
print(material)
print(material.model_dump_json())
This will print the material information of Drinking Water as MaterialModel and it's JSON.
MaterialId='4fca6f5b5e6c3b8a1b887c6dc99db146' CategoryName='consumables (basic)' CategoryId='3f047ec3043bdd795fd7272d6be98799' Name='drinkingWater' Ticker='DW' Weight=0.10000000149011612 Volume=0.10000000149011612 UserNameSubmitted='SAGANAKI' Timestamp=datetime.datetime(2023, 10, 28, 19, 26, 21, 831707)
{
"MaterialId": "4fca6f5b5e6c3b8a1b887c6dc99db146",
"CategoryName": "consumables (basic)",
"CategoryId": "3f047ec3043bdd795fd7272d6be98799",
"Name": "drinkingWater",
"Ticker": "DW",
"Weight": 0.10000000149011612,
"Volume": 0.10000000149011612,
"UserNameSubmitted": "SAGANAKI",
"Timestamp": "2023-10-28T19:26:21.831707"
}
Contributing
We welcome contributions of all types! In order to set up fio_wrapper locally please do the following:
- Install Python + Poetry
- Run the poetry environment and install depenencies
- We are aiming for 100% code coverage
Tests
fio_wrapper uses pytest
, requests_mock
and pytest-cov
to run tests, mock calls towards FIO endpoints and generate the code coverage report and use black
as formatter.
Run tests:
pytest
Generate coverage report:
pytest --cov --cov-report=html:coverage --cov-config=.coveragerc
Documentation
mkdocs gh-deploy
Project details
Release history Release notifications | RSS feed
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 fio_wrapper-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 375ebae11220a5eb73c7664bc3eefe2ede3afd9ee06c79de5549cb2b659fc4e3 |
|
MD5 | 930c6356f67833e828971eceba6c2579 |
|
BLAKE2b-256 | 8f6652505abcc39d31da5da77805a4063c01bd33c2025ab233c2c655c44e7b59 |