Skip to main content

Unnofficial Python wrapper of the unite-db.com REST API.

Project description

py-unite-db

GPL-2 Licensed .github/workflows/ci.yml PyPI Docs: MkDocs Code style: black pdm-managed

Unofficial Python wrapper for the unite-db.com REST API.

Introduction

unite-db is a website dedicated to maintaining a database on various stats in the game Pokemon Unite including stats for Pokemon, Battle Items and Held Items.

This wrapper provides a simple, Pythonic interface to those stats via a REST API, with automatic result caching.

Please be warned that this is an unofficial wrapper and the REST API is a private one, so please do not abuse it.

If you are publishing any of the data collected with this API, please give credit to unite-db. They spend many hours collecting this data.

Installation

The package is installable via pip.

pip install py-unite-db

Usage

Import the UniteDb object:

from py_unite_db import UniteDb

unite_db = UniteDb()

Let's get the names of all supporter Pokemon:

>>> [pokemon.name for pokemon in unite_db.pokemon if pokemon.role == "Supporter"]
['Blissey', 'Eldegoss', 'Mr.Mime', 'Wigglytuff']

Contributing

This project uses pdm.

$ pdm install

Running the tests

The project uses pytest.

$ pdm run pytest

Type Checking

The project must pass mypy type checking.

$ pdm run typecheck

If you are using mypy with an IDE like VS Code make sure you have run

$ pdm run stubs

To work around mypy not supporting PEP582 yet. See https://github.com/python/mypy/issues/10633 for more info on this.

Formatting

Imports are sorted with isort and source files are formatted with black.

$ pdm run format
$ pdm run formatcheck

If you are using VS Code this will be automatically done on save.

Linting

Linting is provided by flake8.

$ pdm run lint

Conventional Commits

The project follows the conventional commit style.

Docs

This project uses mkdocs, mkdocstrings, mkdocs-material for its documentation.

$ pdm run fetch_charm
$ pdm run 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

py-unite-db-0.3.0.tar.gz (26.2 kB view hashes)

Uploaded Source

Built Distribution

py_unite_db-0.3.0-py3-none-any.whl (18.5 kB view hashes)

Uploaded Python 3

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