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.1.tar.gz
.
File metadata
- Download URL: fio_wrapper-1.2.1.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 | 59a3493a298da5a0c7db56ee9ec361511410b1057b0db241e34ea54d2b3942b3 |
|
MD5 | 744029a08b091caef1f30c53befbdeae |
|
BLAKE2b-256 | 2ffd156fe38f509387631941c5c75076abcbf8b42b8acf82ce4ced5cfdc4fa4e |
File details
Details for the file fio_wrapper-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: fio_wrapper-1.2.1-py3-none-any.whl
- Upload date:
- Size: 29.8 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 | 8526051d5ba55ee46dd496968d0dd60e03172006f779e9aea2a65d4063f58a46 |
|
MD5 | 38621f2c02ee9d2a9da9f4597d4ec6ea |
|
BLAKE2b-256 | b88bc3d8e09c235f402599202f006908b67924b5d1d586f2ad6292f39aa1fa3e |