Metadata-Version: 2.4
Name: pyke-lol
Version: 1.3.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.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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
Requires-Dist: bandit (>=1.8.6,<2.0.0)
Requires-Dist: datamodel-code-generator (>=0.34.0,<0.35.0)
Requires-Dist: mypy (>=1.18.2,<2.0.0)
Requires-Dist: pdoc (>=15.0.4,<16.0.0)
Requires-Dist: pydantic (>=2.11.10,<3.0.0)
Requires-Dist: pytest (>=8.4.2,<9.0.0)
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
Requires-Dist: requests (>=2.32.5,<3.0.0)
Requires-Dist: vermin (>=1.7.0,<2.0.0)
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/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pyke-lol)](https://pypi.org/project/pyke-lol/)
![Coverage](https://img.shields.io/badge/Coverage-94%25-brightgreen.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/diodemusic/pyke/blob/main/LICENCE.txt)

**pyke** is an opinionated, simple-by-design Riot API wrapper specifically for League of Legends.

---

## Installation

Install the latest version directly from PyPI:

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

---

## Quickstart

```py
from pyke import Continent, Pyke, exceptions

# We always initialize the API like this
# We can explicitly disable url logging, by default pyke will print the url of every call
api = Pyke("API_KEY", print_url=False)

# Every pyke method follows the same convention as the Riot API
# For example account/v1/accounts/by-riot-id/{gameName}/{tagLine} becomes the following
account = api.account.by_riot_id(Continent.EUROPE, "saves", "000")

# Every response is a pydantic model whose members can be accessed with dot notation
print(f"Riot ID: {account.game_name}#{account.tag_line}")
print(f"PUUID: {account.puuid}")

# We get access to all the methods that come with a pydantic model
# For example a json string
print(account.model_dump_json())
# Or a python dictionary
print(account.model_dump())

# pyke throws custom exceptions, again following the same conventions as the Riot API
# For example a request that responds with error code 429
# Will throw pyke.exceptions.RateLimitExceeded
try:
    region = api.account.region_by_puuid(Continent.EUROPE, account.puuid)
except exceptions.DataNotFound as e:
    print(e)  # Output: Data not found (Error Code: 404)
    quit()

# Members can be accessed with dot notation just like before
print(f"PUUID: {region.puuid}")
print(f"Game: {region.game}")
print(f"Region: {region.region}")
```

> **Note:** You need Python 3.9+ to use pyke.

---

## Features

- Provides a simple, pythonic interface to interact with the Riot API.
- Follows Riot API endpoints and conventions closely.
- Returns Pydantic models for easy access to API data.
- Custom exceptions for error handling, e.g., rate limits.

---

## Documentation & Examples

- [Documentation](https://diodemusic.github.io/pyke/pyke.html)
- [Examples](https://github.com/diodemusic/pyke/tree/master/examples)

---

## Contact me

If you run into issues, or just have a question/need help, you can hit me up on discord.
my username is `.irm`

enjoy :)

![Pyke Logo](https://github.com/diodemusic/pyke/blob/main/assets/logo.png?raw=true)

