fio-wrapper


Namefio-wrapper JSON
Version 1.3.5 PyPI version JSON
download
home_pageNone
SummaryPython API wrapper for Prosperous Universes community API FIO.
upload_time2024-06-12 08:09:56
maintainerNone
docs_urlNone
authorJan
requires_python<4.0,>=3.8
licenseMIT
keywords fio prosperous universe api wrapper
VCS
bugtrack_url
requirements annotated-types astunparse attrs babel black cattrs certifi charset-normalizer click colorama coverage exceptiongroup ghp-import griffe idna importlib-metadata iniconfig jinja2 markdown markupsafe mergedeep mkdocs-autorefs mkdocs-coverage mkdocs-get-deps mkdocs-material-extensions mkdocs-material mkdocs mkdocstrings-python mkdocstrings mkdocstrings mypy-extensions packaging paginate pathspec platformdirs pluggy pydantic-core pydantic pygments pymdown-extensions pytest-cov pytest python-dateutil pytz pyyaml-env-tag pyyaml regex requests-cache requests-mock requests six tomli typing-extensions url-normalize urllib3 watchdog wheel zipp
Travis-CI No Travis.
coveralls test coverage
            # *FIO Wrapper* - Prosperous Universe game data through FIO

[![PyPI - Version](https://img.shields.io/pypi/v/fio-wrapper.svg)](https://pypi.org/project/fio-wrapper)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fio-wrapper.svg)](https://pypi.org/project/fio-wrapper)
[![License: MIT](https://img.shields.io/badge/license-MIT-C06524)](https://github.com/jplacht/fio_wrapper/blob/master/LICENSE.md)
![PyPI - Downloads](https://img.shields.io/pypi/dm/fio-wrapper)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/5bdfeae4188143c7abeb3316aa1acce0)](https://app.codacy.com/gh/jplacht/fio_wrapper/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/5bdfeae4188143c7abeb3316aa1acce0)](https://app.codacy.com/gh/jplacht/fio_wrapper/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

---

[FIO](https://doc.fnar.net/) API wrapper with [pydantic](https://github.com/pydantic/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](https://prunplanner.org/), the Prosperous Universe Empire and Base Planning Tool.

- Source Code: [https://github.com/prunplanner/fio_wrapper](https://github.com/prunplanner/fio_wrapper)
- Documentation: [https://prunplanner.github.io/fio_wrapper/](https://prunplanner.github.io/fio_wrapper/)
- PyPi Package: [https://pypi.org/project/fio-wrapper/](https://pypi.org/project/fio-wrapper/)

# Usage
## Installation
```python
pip install fio-wrapper
```

## Access data
Creating the FIO adapter and looking for information about the material Drinking Water by its ticker "DW".
```python
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.
```python
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)
```

```json
{
    "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:
```shell
pytest 
```

Generate coverage report:
```shell
pytest --cov --cov-report=html:coverage --cov-config=.coveragerc
```

# Documentation

```shell
mkdocs serve 
```
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fio-wrapper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "fio, prosperous universe, api, wrapper",
    "author": "Jan",
    "author_email": "jplacht+pyfio@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8f/80/dd2314688d98a8a377b31297a8fcc9509dc7aa334c1f2f9142ec67ebfda8/fio_wrapper-1.3.5.tar.gz",
    "platform": null,
    "description": "# *FIO Wrapper* - Prosperous Universe game data through FIO\n\n[![PyPI - Version](https://img.shields.io/pypi/v/fio-wrapper.svg)](https://pypi.org/project/fio-wrapper)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fio-wrapper.svg)](https://pypi.org/project/fio-wrapper)\n[![License: MIT](https://img.shields.io/badge/license-MIT-C06524)](https://github.com/jplacht/fio_wrapper/blob/master/LICENSE.md)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/fio-wrapper)\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/5bdfeae4188143c7abeb3316aa1acce0)](https://app.codacy.com/gh/jplacht/fio_wrapper/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/5bdfeae4188143c7abeb3316aa1acce0)](https://app.codacy.com/gh/jplacht/fio_wrapper/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)\n\n---\n\n[FIO](https://doc.fnar.net/) API wrapper with [pydantic](https://github.com/pydantic/pydantic) data validation and easy-to-use querying. **FIO Wrapper** implements the most used endpoints of Prosperous Universes community game data API.\n\nFIO Wrapper was developed as part of [PRUNplanner](https://prunplanner.org/), the Prosperous Universe Empire and Base Planning Tool.\n\n- Source Code: [https://github.com/prunplanner/fio_wrapper](https://github.com/prunplanner/fio_wrapper)\n- Documentation: [https://prunplanner.github.io/fio_wrapper/](https://prunplanner.github.io/fio_wrapper/)\n- PyPi Package: [https://pypi.org/project/fio-wrapper/](https://pypi.org/project/fio-wrapper/)\n\n# Usage\n## Installation\n```python\npip install fio-wrapper\n```\n\n## Access data\nCreating the FIO adapter and looking for information about the material Drinking Water by its ticker \"DW\".\n```python\nfrom fio_wrapper import FIO\n\nfio = FIO()\n\nmaterial = fio.Material.get(\"DW\")\nprint(material)\nprint(material.model_dump_json())\n```\n\nThis will print the material information of Drinking Water as MaterialModel and it's JSON.\n```python\nMaterialId='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)\n```\n\n```json\n{\n    \"MaterialId\": \"4fca6f5b5e6c3b8a1b887c6dc99db146\",\n    \"CategoryName\": \"consumables (basic)\",\n    \"CategoryId\": \"3f047ec3043bdd795fd7272d6be98799\",\n    \"Name\": \"drinkingWater\",\n    \"Ticker\": \"DW\",\n    \"Weight\": 0.10000000149011612,\n    \"Volume\": 0.10000000149011612,\n    \"UserNameSubmitted\": \"SAGANAKI\",\n    \"Timestamp\": \"2023-10-28T19:26:21.831707\"\n}\n```\n\n# Contributing\n\nWe welcome contributions of all types! In order to set up **fio_wrapper** locally please do the following:\n\n1. Install Python + Poetry\n2. Run the poetry environment and install depenencies\n3. We are aiming for 100% code coverage\n\n# Tests\n\n**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.\n\nRun tests:\n```shell\npytest \n```\n\nGenerate coverage report:\n```shell\npytest --cov --cov-report=html:coverage --cov-config=.coveragerc\n```\n\n# Documentation\n\n```shell\nmkdocs serve \n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API wrapper for Prosperous Universes community API FIO.",
    "version": "1.3.5",
    "project_urls": {
        "Documentation": "https://prunplanner.github.io/fio_wrapper/",
        "Homepage": "https://prunplanner.github.io/fio_wrapper/",
        "Source": "https://github.com/prunplanner/fio_wrapper"
    },
    "split_keywords": [
        "fio",
        " prosperous universe",
        " api",
        " wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21dcdda4318c070b21c3a29917ff54ae62a7bb45f9598f3673b9cec597a52af1",
                "md5": "18f9e9238c0b88641f462ddc141af756",
                "sha256": "29f264f951bcf99e294b447b0de6692b9e73bb5839213a8bec7a49667cb77cf3"
            },
            "downloads": -1,
            "filename": "fio_wrapper-1.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18f9e9238c0b88641f462ddc141af756",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 37357,
            "upload_time": "2024-06-12T08:09:55",
            "upload_time_iso_8601": "2024-06-12T08:09:55.697196Z",
            "url": "https://files.pythonhosted.org/packages/21/dc/dda4318c070b21c3a29917ff54ae62a7bb45f9598f3673b9cec597a52af1/fio_wrapper-1.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f80dd2314688d98a8a377b31297a8fcc9509dc7aa334c1f2f9142ec67ebfda8",
                "md5": "94108b562917b27d526f65e09a2a352f",
                "sha256": "8ff7d895a1c6b0b5e4c6e57509bd8d485c96301b297a1162b63744276e4791ce"
            },
            "downloads": -1,
            "filename": "fio_wrapper-1.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "94108b562917b27d526f65e09a2a352f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 22093,
            "upload_time": "2024-06-12T08:09:56",
            "upload_time_iso_8601": "2024-06-12T08:09:56.701741Z",
            "url": "https://files.pythonhosted.org/packages/8f/80/dd2314688d98a8a377b31297a8fcc9509dc7aa334c1f2f9142ec67ebfda8/fio_wrapper-1.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-12 08:09:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "prunplanner",
    "github_project": "fio_wrapper",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "annotated-types",
            "specs": [
                [
                    "==",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "astunparse",
            "specs": [
                [
                    "==",
                    "1.6.3"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "23.2.0"
                ]
            ]
        },
        {
            "name": "babel",
            "specs": [
                [
                    "==",
                    "2.15.0"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    "==",
                    "23.12.1"
                ]
            ]
        },
        {
            "name": "cattrs",
            "specs": [
                [
                    "==",
                    "23.2.3"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.6.2"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.3.2"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    "==",
                    "7.5.3"
                ]
            ]
        },
        {
            "name": "exceptiongroup",
            "specs": [
                [
                    "==",
                    "1.2.1"
                ]
            ]
        },
        {
            "name": "ghp-import",
            "specs": [
                [
                    "==",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "griffe",
            "specs": [
                [
                    "==",
                    "0.45.3"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.7"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "7.1.0"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.4"
                ]
            ]
        },
        {
            "name": "markdown",
            "specs": [
                [
                    "==",
                    "3.6"
                ]
            ]
        },
        {
            "name": "markupsafe",
            "specs": [
                [
                    "==",
                    "2.1.5"
                ]
            ]
        },
        {
            "name": "mergedeep",
            "specs": [
                [
                    "==",
                    "1.3.4"
                ]
            ]
        },
        {
            "name": "mkdocs-autorefs",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "mkdocs-coverage",
            "specs": [
                [
                    "==",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "mkdocs-get-deps",
            "specs": [
                [
                    "==",
                    "0.2.0"
                ]
            ]
        },
        {
            "name": "mkdocs-material-extensions",
            "specs": [
                [
                    "==",
                    "1.3.1"
                ]
            ]
        },
        {
            "name": "mkdocs-material",
            "specs": [
                [
                    "==",
                    "9.5.26"
                ]
            ]
        },
        {
            "name": "mkdocs",
            "specs": [
                [
                    "==",
                    "1.6.0"
                ]
            ]
        },
        {
            "name": "mkdocstrings-python",
            "specs": [
                [
                    "==",
                    "1.8.0"
                ]
            ]
        },
        {
            "name": "mkdocstrings",
            "specs": [
                [
                    "==",
                    "0.23.0"
                ]
            ]
        },
        {
            "name": "mkdocstrings",
            "specs": [
                [
                    "==",
                    "0.23.0"
                ]
            ]
        },
        {
            "name": "mypy-extensions",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "24.1"
                ]
            ]
        },
        {
            "name": "paginate",
            "specs": [
                [
                    "==",
                    "0.5.6"
                ]
            ]
        },
        {
            "name": "pathspec",
            "specs": [
                [
                    "==",
                    "0.12.1"
                ]
            ]
        },
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "4.2.2"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.5.0"
                ]
            ]
        },
        {
            "name": "pydantic-core",
            "specs": [
                [
                    "==",
                    "2.18.4"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "2.7.3"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": [
                [
                    "==",
                    "2.18.0"
                ]
            ]
        },
        {
            "name": "pymdown-extensions",
            "specs": [
                [
                    "==",
                    "10.8.1"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.4.4"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2024.1"
                ]
            ]
        },
        {
            "name": "pyyaml-env-tag",
            "specs": [
                [
                    "==",
                    "0.1"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "regex",
            "specs": [
                [
                    "==",
                    "2024.5.15"
                ]
            ]
        },
        {
            "name": "requests-cache",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "requests-mock",
            "specs": [
                [
                    "==",
                    "1.12.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "tomli",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        },
        {
            "name": "url-normalize",
            "specs": [
                [
                    "==",
                    "1.4.3"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "watchdog",
            "specs": [
                [
                    "==",
                    "4.0.1"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.43.0"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.19.2"
                ]
            ]
        }
    ],
    "lcname": "fio-wrapper"
}
        
Jan
Elapsed time: 0.94205s