diff --git a/.pdm-python b/.pdm-python new file mode 100644 index 0000000..0186d5b --- /dev/null +++ b/.pdm-python @@ -0,0 +1 @@ +/home/jay/.pyenv/versions/3.10.4/bin/python3.10 \ No newline at end of file diff --git a/README.md b/README.md index fba5429..9f32ef5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# py-unite-db +# py-unite-db ![GPL-2 Licensed](https://img.shields.io/badge/license-GPL--2-green) [![.github/workflows/ci.yml](https://github.com/jaynewey/py-unite-db/actions/workflows/ci.yml/badge.svg)](https://github.com/jaynewey/py-unite-db/actions/workflows/ci.yml) @@ -89,7 +89,7 @@ If you are using VS Code this will be automatically done on save. ### Linting -Linting is provided by [`flake8`](github.com/pycqa/flake8). +Linting is provided by [`flake8`](https://github.com/pycqa/flake8). ```sh $ pdm run lint diff --git a/py_unite_db/__init__.py b/py_unite_db/__init__.py index 3a7ee85..0b9d4de 100644 --- a/py_unite_db/__init__.py +++ b/py_unite_db/__init__.py @@ -12,12 +12,14 @@ class UniteDb(UniteDbBase): """Wrapper for the Unite DB rest API. Example: + ```python >>> from py_unite_db import UniteDb >>> unite_db = UniteDb() >>> unite_db.pokemon[0].name 'Absol' >>> unite_db.held_items[0].name 'Aeos Cookie' + ``` """ def __init__(self): diff --git a/py_unite_db/models/pokemon.py b/py_unite_db/models/pokemon.py index 6677ae7..a9baffc 100644 --- a/py_unite_db/models/pokemon.py +++ b/py_unite_db/models/pokemon.py @@ -34,6 +34,7 @@ class Pokemon(BaseModel): [`UniteDb.pokemon`][py_unite_db.UniteDb]. Example: + ```python >>> from py_unite_db import UniteDb >>> unite_db = UniteDb() @@ -41,6 +42,7 @@ class Pokemon(BaseModel): 'Absol' >>> unite_db.pokemon[0].tier 'C' + ``` """ name: str = Field(..., description="Name of the Pokemon.") @@ -73,9 +75,11 @@ def stats_at(self, level: int) -> Stats: level: The level at which to get stats at. Example: + ```python >>> from py_unite_db import UniteDb >>> UniteDb().pokemon[0].stats_at(7) Stats(hp=3823, attack=293, defense=109, sp_attack=47, sp_defense=76, crit=5, cooldown_reduction=10, lifesteal=0) + ``` If the level given is less than 1, gets level 1. @@ -91,6 +95,7 @@ def name_at(self, level: int) -> str: For example, Blastoise only becomes Blastoise at level 9. Example: + ```python >>> from py_unite_db import UniteDb >>> UniteDb().pokemon[1].name 'Blastoise' @@ -100,6 +105,7 @@ def name_at(self, level: int) -> str: 'Wartortle' >>> UniteDb().pokemon[1].name_at(9) 'Blastoise' + ``` If the level given is less than 1, gets level 1. If the level given is more than 15, gets level 15. diff --git a/py_unite_db/types.py b/py_unite_db/types.py index 0de3782..805c0e5 100644 --- a/py_unite_db/types.py +++ b/py_unite_db/types.py @@ -1,6 +1,6 @@ from typing import Literal -Tier = Literal["S", "A", "B", "C", "D", "E", "T", "Y"] +Tier = Literal["S", "A", "B", "C", "D", "E", "T"] DamageType = Literal["Physical", "Special"] Range = Literal["Ranged", "Melee"] Difficulty = Literal["Novice", "Intermediate", "Expert"]