Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pdm-python
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/jay/.pyenv/versions/3.10.4/bin/python3.10
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions py_unite_db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 6 additions & 0 deletions py_unite_db/models/pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ class Pokemon(BaseModel):
[`UniteDb.pokemon`][py_unite_db.UniteDb].

Example:
```python
>>> from py_unite_db import UniteDb
>>> unite_db = UniteDb()

>>> unite_db.pokemon[0].name
'Absol'
>>> unite_db.pokemon[0].tier
'C'
```
"""

name: str = Field(..., description="Name of the Pokemon.")
Expand Down Expand Up @@ -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.
Expand All @@ -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'
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion py_unite_db/types.py
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down