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.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 663aeeb38e1e1e7d5f93b6990cb8bccffb432f0ac3166c2b6c0b7181fa10ed82 |
|
MD5 | 02b16f8df3b505a01ea45ac5de417a56 |
|
BLAKE2b-256 | 73594c12f0970196d9fabb848ad472054a6cb7459000179554000fe89f62e5fb |