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.
FIO Wrapper was developed as part of PRUNplanner, the Prosperous Universe Empire and Base Planning Tool.
- 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
File details
Details for the file fio_wrapper-1.2.0.tar.gz
.
File metadata
- Download URL: fio_wrapper-1.2.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.12.0 Linux/6.2.0-1015-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5e346292f85b9d84ee2f3920a40e0b4cf0761b2f2eb462bb4b28d3fb7c8e36 |
|
MD5 | 34cf96ba519244a5f252b75aedf1d17d |
|
BLAKE2b-256 | dd9711277d7a588013aa459c8b7b3632745ecf4f640bf6c6d64b387c02f4bd4d |
File details
Details for the file fio_wrapper-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: fio_wrapper-1.2.0-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.12.0 Linux/6.2.0-1015-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e54271803394691082de011dc5d59901a79300ab2ff0335cb9a37a4bef011f2 |
|
MD5 | fb71f50a9885233eeea95432abb9446a |
|
BLAKE2b-256 | 58f18ef8aa2d7a8dad9237f4a1ddbb1cf1cabe390b2edbd5d7922df59ab5d5ec |