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
Quickstart
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.10+ 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
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 :)
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.3.0.tar.gz.
File metadata
- Download URL: pyke_lol-1.3.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e20e361e058c45ab468ea9ef1a180207ad2e8e2bfd32b1af1499eb4b5cd807f
|
|
| MD5 |
ef11b481bba959c67f047a3e74a03091
|
|
| BLAKE2b-256 |
b43baae5183652d01333f6603b96fb037d9d049b25df4c11a86fb744a56ee4e1
|
Provenance
The following attestation bundles were made for pyke_lol-1.3.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.3.0.tar.gz -
Subject digest:
6e20e361e058c45ab468ea9ef1a180207ad2e8e2bfd32b1af1499eb4b5cd807f - Sigstore transparency entry: 637608012
- Sigstore integration time:
-
Permalink:
diodemusic/pyke@1672b8d60c1f5935f453fb1882666b0e4cafc20f -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/diodemusic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1672b8d60c1f5935f453fb1882666b0e4cafc20f -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyke_lol-1.3.0-py3-none-any.whl.
File metadata
- Download URL: pyke_lol-1.3.0-py3-none-any.whl
- Upload date:
- Size: 41.2 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 |
66f2f8459e282677d74f5f78d52d3905b1af756eb4f3395b64a2a591a48db796
|
|
| MD5 |
051dbea6ac7b44972fdd8c5251e87078
|
|
| BLAKE2b-256 |
5f7df60a5c33b2b56095331eac8f8e37de7f4731cc188a4560dd9e3f9ff6463d
|
Provenance
The following attestation bundles were made for pyke_lol-1.3.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.3.0-py3-none-any.whl -
Subject digest:
66f2f8459e282677d74f5f78d52d3905b1af756eb4f3395b64a2a591a48db796 - Sigstore transparency entry: 637608013
- Sigstore integration time:
-
Permalink:
diodemusic/pyke@1672b8d60c1f5935f453fb1882666b0e4cafc20f -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/diodemusic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1672b8d60c1f5935f453fb1882666b0e4cafc20f -
Trigger Event:
release
-
Statement type: