A Riot API wrapper specifically for League of Legends.
Project description
pyke
pyke is a thin async Riot API wrapper for League of Legends.
Installation
Install the latest version directly from PyPI:
pip install pyke-lol
You need Python 3.10+
Quickstart
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:
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
For any questions or help, please reach out on Discord: .irm
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-3.1.1.tar.gz.
File metadata
- Download URL: pyke_lol-3.1.1.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8448823ac4f07c60a1183d8b5483b7d3294f92993ccf5d73fe2916c055f27124
|
|
| MD5 |
d350dffd2ba3e97ca8c675289e489af1
|
|
| BLAKE2b-256 |
0914a7f8c442698737f88436226a5fc35f2c916616433ffef4dba589db81778a
|
Provenance
The following attestation bundles were made for pyke_lol-3.1.1.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-3.1.1.tar.gz -
Subject digest:
8448823ac4f07c60a1183d8b5483b7d3294f92993ccf5d73fe2916c055f27124 - Sigstore transparency entry: 977303284
- Sigstore integration time:
-
Permalink:
diodemusic/pyke@dd8251a02396902a2317bd679b286c552ce3dfb1 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/diodemusic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@dd8251a02396902a2317bd679b286c552ce3dfb1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyke_lol-3.1.1-py3-none-any.whl.
File metadata
- Download URL: pyke_lol-3.1.1-py3-none-any.whl
- Upload date:
- Size: 27.9 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 |
0c18be294759a93ba7e50779595a14f7a5fc125934910a1a20c528334b2ac775
|
|
| MD5 |
fea9da21aef602da1647ea1ba5a3a8d2
|
|
| BLAKE2b-256 |
5e42914903731b9bcddb93a789aceeae7efd0fc0e432665e9a802adc55dba62f
|
Provenance
The following attestation bundles were made for pyke_lol-3.1.1-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-3.1.1-py3-none-any.whl -
Subject digest:
0c18be294759a93ba7e50779595a14f7a5fc125934910a1a20c528334b2ac775 - Sigstore transparency entry: 977303315
- Sigstore integration time:
-
Permalink:
diodemusic/pyke@dd8251a02396902a2317bd679b286c552ce3dfb1 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/diodemusic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@dd8251a02396902a2317bd679b286c552ce3dfb1 -
Trigger Event:
release
-
Statement type: