Skip to main content

Python API wrapper for Prosperous Universes community API FIO.

Project description

FIO Wrapper - Prosperous Universe game data through FIO

PyPI - Version PyPI - Python Version License: MIT PyPI - Downloads

Codacy Badge Codacy Badge


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.

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:

  1. Install Python + Poetry
  2. Run the poetry environment and install depenencies
  3. 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 serve 

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

fio_wrapper-1.3.5.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

fio_wrapper-1.3.5-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file fio_wrapper-1.3.5.tar.gz.

File metadata

  • Download URL: fio_wrapper-1.3.5.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for fio_wrapper-1.3.5.tar.gz
Algorithm Hash digest
SHA256 8ff7d895a1c6b0b5e4c6e57509bd8d485c96301b297a1162b63744276e4791ce
MD5 94108b562917b27d526f65e09a2a352f
BLAKE2b-256 8f80dd2314688d98a8a377b31297a8fcc9509dc7aa334c1f2f9142ec67ebfda8

See more details on using hashes here.

File details

Details for the file fio_wrapper-1.3.5-py3-none-any.whl.

File metadata

  • Download URL: fio_wrapper-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for fio_wrapper-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 29f264f951bcf99e294b447b0de6692b9e73bb5839213a8bec7a49667cb77cf3
MD5 18f9e9238c0b88641f462ddc141af756
BLAKE2b-256 21dcdda4318c070b21c3a29917ff54ae62a7bb45f9598f3673b9cec597a52af1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page