A Riot API wrapper specifically for League of Legends.
Project description
pyke
pyke is an opinionated, simple-by-design Riot API wrapper specifically for League of Legends.
Installation
WIP
Features
- Provides a simple, pythonic interface to interact with the Riot API.
Documentation & Examples
Example Usage
from pyke import Pyke
# We always initialize the API like this
# Check examples/example.py for loading an api key from a .env file
api = Pyke("API_KEY")
# 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
# We can get 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.RateLimitExceeded as e:
print(e) # Output: Rate limit exceeded (Error Code: 429)
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}")
enjoy :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyke_lol-0.1.0.tar.gz
(62.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pyke_lol-0.1.0-py3-none-any.whl
(78.9 kB
view details)
File details
Details for the file pyke_lol-0.1.0.tar.gz.
File metadata
- Download URL: pyke_lol-0.1.0.tar.gz
- Upload date:
- Size: 62.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.7 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96b8c3b637d0b49f5feb0f0f65dac51ad739da0424a5dc0b9c00bcd95218b432
|
|
| MD5 |
cb7d1b1a6562a4af067ee4e0692fbc08
|
|
| BLAKE2b-256 |
2fee8e76d171ccef940da0f11baacce3084eebeec7e5fb5ec6cd935705138c98
|
File details
Details for the file pyke_lol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyke_lol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 78.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.7 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d0091a9274258b245ff2780632fddca725f64e8bd447a11e9d385188a9813c0
|
|
| MD5 |
6ffe8c2437965bcf78211e413c60662d
|
|
| BLAKE2b-256 |
e3cc99a572514c35d5ac6c3e73b04085420e3f5dfec0bce02f9dbd7638f26031
|