Metadata-Version: 2.4
Name: pyke-lol
Version: 3.1.1
Summary: A Riot API wrapper specifically for League of Legends.
License: MIT
License-File: LICENCE.txt
Keywords: riot api,league of legends,lol api,riot python,riot wrapper,LoL,League of Legends,Riot Games,API,REST,restful api
Author: diodemusic
Requires-Python: >=3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: anyio (>=4.12.1,<5.0.0) ; extra == "dev"
Requires-Dist: bandit (>=1.8.6,<2.0.0) ; extra == "dev"
Requires-Dist: black (>=24.0.0) ; extra == "dev"
Requires-Dist: case-converter (>=1.2.0,<2.0.0) ; extra == "dev"
Requires-Dist: datamodel-code-generator (>=0.34.0,<0.35.0) ; extra == "dev"
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: mypy (>=1.18.2,<2.0.0) ; extra == "dev"
Requires-Dist: pdoc (>=15.0.4,<16.0.0) ; extra == "dev"
Requires-Dist: pytest-asyncio (>=1.3.0,<2.0.0) ; extra == "dev"
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0) ; extra == "dev"
Requires-Dist: respx (>=0.22.0,<0.23.0) ; extra == "dev"
Description-Content-Type: text/markdown

# pyke

[![PyPI - Version](https://img.shields.io/pypi/v/pyke-lol)](https://pypi.org/project/pyke-lol/)
[![Documentation](https://img.shields.io/badge/Documentation-blue)](https://diodemusic.github.io/pyke/)

**pyke** is a thin async Riot API wrapper for League of Legends.

## Installation

Install the latest version directly from PyPI:

```bash
pip install pyke-lol
```

> You need Python 3.10+

---

## Quickstart

```py
import asyncio

from pyke import Continent, Pyke, exceptions

async def main() -> None:
    # Initialize the API
    async with Pyke("RGAPI-...", timeout=60, print_url=True, print_rate_limit=True) as api:
        # Every pyke method follows the same convention as the Riot API
        # For example account/v1/accounts/by-riot-id/{gameName}/{tagLine} becomes:
        account = await api.account.by_riot_id(Continent.EUROPE, "saves", "000")

        print(f"Riot ID: {account['gameName']}#{account['tagLine']}")
        print(f"PUUID:   {account['puuid']}")

        # pyke throws typed exceptions matching Riot API error codes
        try:
            region = await api.account.region_by_puuid(
                Continent.EUROPE, account["puuid"]
            )
        except exceptions.DataNotFound as e:
            print(e)  # Output: Data not found (Error Code: 404)
            quit()

        print(f"Region:  {region['region']}")
```

## Custom Exception Handling

Typed exceptions for all HTTP status codes:

```py
from pyke import exceptions

try:
    summoner = await api.summoner.by_puuid(Region.EUW, "NonExistentPuuid")
except exceptions.DataNotFound as e:
    print(f"Not found: {e}")     # Data not found (Error Code: 404)
except exceptions.RateLimitExceeded as e:
    print(f"Rate limited: {e}")  # Rate limit exceeded (Error Code: 429)
except exceptions.InternalServerError as e:
    print(f"Server error: {e}")  # Internal server error (Error Code: 500)
```

## Resources

- **[API Documentation](https://diodemusic.github.io/pyke/pyke.html)**
- **[Examples Directory](https://github.com/diodemusic/pyke/tree/master/examples)**
- **[PyPI Package](https://pypi.org/project/pyke-lol/)**
- **[GitHub Repository](https://github.com/diodemusic/pyke)**

---

For any questions or help, please reach out on Discord: `.irm`

