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
Install the latest version directly from PyPI:
pip install pyke-lol
Note: You need Python 3.13+ 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
I am currently working on adding documentation
Example Usage
from pyke import Pyke
# We always initialize the API like this
# You'll need a valid api key from the Riot games developer website
# Check examples/example.py for loading your 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
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
File details
Details for the file pyke_lol-1.0.0.tar.gz.
File metadata
- Download URL: pyke_lol-1.0.0.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a12edf6f38ce856974d564814ea1089159f5bf350a8306361340ae982915db15
|
|
| MD5 |
ed14ad4270412fad72c3e1fc49b2f2f2
|
|
| BLAKE2b-256 |
0b98ddd5b56a487ec6939c9a5632e20db32fcf2fee26b74b9154af2af2e6d363
|
Provenance
The following attestation bundles were made for pyke_lol-1.0.0.tar.gz:
Publisher:
python-publish.yml on diodemusic/pyke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyke_lol-1.0.0.tar.gz -
Subject digest:
a12edf6f38ce856974d564814ea1089159f5bf350a8306361340ae982915db15 - Sigstore transparency entry: 613450027
- Sigstore integration time:
-
Permalink:
diodemusic/pyke@94be7cb5dfd938f40641dee0880a64586044881c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/diodemusic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@94be7cb5dfd938f40641dee0880a64586044881c -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyke_lol-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyke_lol-1.0.0-py3-none-any.whl
- Upload date:
- Size: 39.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45c5f87ac0486a667d93fdca7458ecee0a813a6fe8cd207f32085a4bd3b900d6
|
|
| MD5 |
f6519c3510510059a3aef079283308cd
|
|
| BLAKE2b-256 |
2a8d8b52d25c65cd1412548d1a7f36f8c84ef834774dc081bcec1f47ee9638d0
|
Provenance
The following attestation bundles were made for pyke_lol-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on diodemusic/pyke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyke_lol-1.0.0-py3-none-any.whl -
Subject digest:
45c5f87ac0486a667d93fdca7458ecee0a813a6fe8cd207f32085a4bd3b900d6 - Sigstore transparency entry: 613450076
- Sigstore integration time:
-
Permalink:
diodemusic/pyke@94be7cb5dfd938f40641dee0880a64586044881c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/diodemusic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@94be7cb5dfd938f40641dee0880a64586044881c -
Trigger Event:
release
-
Statement type: