pyke-lol 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyke_lol-0.1.0/LICENCE.txt +21 -0
- pyke_lol-0.1.0/PKG-INFO +78 -0
- pyke_lol-0.1.0/README.md +57 -0
- pyke_lol-0.1.0/pyproject.toml +38 -0
- pyke_lol-0.1.0/src/pyke/__init__.py +22 -0
- pyke_lol-0.1.0/src/pyke/__version__.py +3 -0
- pyke_lol-0.1.0/src/pyke/_base_client.py +70 -0
- pyke_lol-0.1.0/src/pyke/_enums/__init__.py +0 -0
- pyke_lol-0.1.0/src/pyke/_enums/continent.py +10 -0
- pyke_lol-0.1.0/src/pyke/_enums/division.py +10 -0
- pyke_lol-0.1.0/src/pyke/_enums/level.py +20 -0
- pyke_lol-0.1.0/src/pyke/_enums/queue.py +6 -0
- pyke_lol-0.1.0/src/pyke/_enums/region.py +21 -0
- pyke_lol-0.1.0/src/pyke/_enums/tier.py +14 -0
- pyke_lol-0.1.0/src/pyke/_enums/type.py +8 -0
- pyke_lol-0.1.0/src/pyke/_models/__init__.py +18 -0
- pyke_lol-0.1.0/src/pyke/_models/account_v1.py +40 -0
- pyke_lol-0.1.0/src/pyke/_models/challenges_v1.py +110 -0
- pyke_lol-0.1.0/src/pyke/_models/champion_mastery_v4.py +78 -0
- pyke_lol-0.1.0/src/pyke/_models/champion_v3.py +17 -0
- pyke_lol-0.1.0/src/pyke/_models/clash_v1.py +61 -0
- pyke_lol-0.1.0/src/pyke/_models/league_exp_v4.py +41 -0
- pyke_lol-0.1.0/src/pyke/_models/league_v4.py +65 -0
- pyke_lol-0.1.0/src/pyke/_models/match_v5.py +878 -0
- pyke_lol-0.1.0/src/pyke/_models/spectator_v5.py +220 -0
- pyke_lol-0.1.0/src/pyke/_models/status_v4.py +82 -0
- pyke_lol-0.1.0/src/pyke/_models/summoner_v4.py +34 -0
- pyke_lol-0.1.0/src/pyke/_models/tournament_stub_v5.py +148 -0
- pyke_lol-0.1.0/src/pyke/_models/tournament_v5.py +199 -0
- pyke_lol-0.1.0/src/pyke/_schema/get_schema_json.py +18 -0
- pyke_lol-0.1.0/src/pyke/_schema/schema.json +18649 -0
- pyke_lol-0.1.0/src/pyke/endpoints/__init__.py +0 -0
- pyke_lol-0.1.0/src/pyke/endpoints/account.py +60 -0
- pyke_lol-0.1.0/src/pyke/endpoints/challenges.py +124 -0
- pyke_lol-0.1.0/src/pyke/endpoints/champion.py +24 -0
- pyke_lol-0.1.0/src/pyke/endpoints/champion_mastery.py +92 -0
- pyke_lol-0.1.0/src/pyke/endpoints/clash.py +6 -0
- pyke_lol-0.1.0/src/pyke/endpoints/league.py +138 -0
- pyke_lol-0.1.0/src/pyke/endpoints/league_exp.py +41 -0
- pyke_lol-0.1.0/src/pyke/endpoints/match.py +83 -0
- pyke_lol-0.1.0/src/pyke/endpoints/spectator.py +6 -0
- pyke_lol-0.1.0/src/pyke/endpoints/status.py +6 -0
- pyke_lol-0.1.0/src/pyke/endpoints/summoner.py +6 -0
- pyke_lol-0.1.0/src/pyke/endpoints/tournament.py +6 -0
- pyke_lol-0.1.0/src/pyke/endpoints/tournament_stub.py +6 -0
- pyke_lol-0.1.0/src/pyke/exceptions.py +108 -0
- pyke_lol-0.1.0/src/pyke/main.py +34 -0
- pyke_lol-0.1.0/src/pyke/py.typed +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 saves
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pyke_lol-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyke-lol
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Riot API wrapper specifically for League of Legends.
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENCE.txt
|
|
7
|
+
Author: diodemusic
|
|
8
|
+
Requires-Python: >=3.13
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Requires-Dist: datamodel-code-generator (>=0.34.0,<0.35.0)
|
|
14
|
+
Requires-Dist: pdoc (>=15.0.4,<16.0.0)
|
|
15
|
+
Requires-Dist: pydantic (>=2.11.10,<3.0.0)
|
|
16
|
+
Requires-Dist: pytest (>=8.4.2,<9.0.0)
|
|
17
|
+
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
|
|
18
|
+
Requires-Dist: requests (>=2.32.5,<3.0.0)
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# pyke
|
|
22
|
+
|
|
23
|
+
**pyke** is an opinionated, simple-by-design Riot API wrapper specifically for League of Legends.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
WIP
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Provides a simple, pythonic interface to interact with the Riot API.
|
|
32
|
+
|
|
33
|
+
## Documentation & Examples
|
|
34
|
+
|
|
35
|
+
- [Documentation (WIP)](/)
|
|
36
|
+
- [Examples](https://github.com/diodemusic/pyke/tree/master/examples)
|
|
37
|
+
|
|
38
|
+
## Example Usage
|
|
39
|
+
|
|
40
|
+
```py
|
|
41
|
+
from pyke import Pyke
|
|
42
|
+
|
|
43
|
+
# We always initialize the API like this
|
|
44
|
+
# Check examples/example.py for loading an api key from a .env file
|
|
45
|
+
api = Pyke("API_KEY")
|
|
46
|
+
|
|
47
|
+
# Every pyke method follows the same convention as the Riot API
|
|
48
|
+
# For example account/v1/accounts/by-riot-id/{gameName}/{tagLine} becomes the following
|
|
49
|
+
account = api.account.by_riot_id(Continent.EUROPE, "saves", "000")
|
|
50
|
+
|
|
51
|
+
# Every response is a pydantic model whose members can be accessed with dot notation
|
|
52
|
+
print(f"Riot ID: {account.game_name}#{account.tag_line}")
|
|
53
|
+
print(f"PUUID: {account.puuid}")
|
|
54
|
+
|
|
55
|
+
# We get access to all the methods that come with a pydantic model
|
|
56
|
+
# We can get a json string
|
|
57
|
+
print(account.model_dump_json())
|
|
58
|
+
# Or a python dictionary
|
|
59
|
+
print(account.model_dump())
|
|
60
|
+
|
|
61
|
+
# pyke throws custom exceptions, again following the same conventions as the Riot API
|
|
62
|
+
# For example a request that responds with error code 429
|
|
63
|
+
# Will throw pyke.exceptions.RateLimitExceeded
|
|
64
|
+
try:
|
|
65
|
+
region = api.account.region_by_puuid(Continent.EUROPE, account.puuid)
|
|
66
|
+
except exceptions.RateLimitExceeded as e:
|
|
67
|
+
print(e) # Output: Rate limit exceeded (Error Code: 429)
|
|
68
|
+
quit()
|
|
69
|
+
|
|
70
|
+
# Members can be accessed with dot notation just like before
|
|
71
|
+
print(f"PUUID: {region.puuid}")
|
|
72
|
+
print(f"Game: {region.game}")
|
|
73
|
+
print(f"Region: {region.region}")
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
enjoy :)
|
|
78
|
+
|
pyke_lol-0.1.0/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# pyke
|
|
2
|
+
|
|
3
|
+
**pyke** is an opinionated, simple-by-design Riot API wrapper specifically for League of Legends.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
WIP
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Provides a simple, pythonic interface to interact with the Riot API.
|
|
12
|
+
|
|
13
|
+
## Documentation & Examples
|
|
14
|
+
|
|
15
|
+
- [Documentation (WIP)](/)
|
|
16
|
+
- [Examples](https://github.com/diodemusic/pyke/tree/master/examples)
|
|
17
|
+
|
|
18
|
+
## Example Usage
|
|
19
|
+
|
|
20
|
+
```py
|
|
21
|
+
from pyke import Pyke
|
|
22
|
+
|
|
23
|
+
# We always initialize the API like this
|
|
24
|
+
# Check examples/example.py for loading an api key from a .env file
|
|
25
|
+
api = Pyke("API_KEY")
|
|
26
|
+
|
|
27
|
+
# Every pyke method follows the same convention as the Riot API
|
|
28
|
+
# For example account/v1/accounts/by-riot-id/{gameName}/{tagLine} becomes the following
|
|
29
|
+
account = api.account.by_riot_id(Continent.EUROPE, "saves", "000")
|
|
30
|
+
|
|
31
|
+
# Every response is a pydantic model whose members can be accessed with dot notation
|
|
32
|
+
print(f"Riot ID: {account.game_name}#{account.tag_line}")
|
|
33
|
+
print(f"PUUID: {account.puuid}")
|
|
34
|
+
|
|
35
|
+
# We get access to all the methods that come with a pydantic model
|
|
36
|
+
# We can get a json string
|
|
37
|
+
print(account.model_dump_json())
|
|
38
|
+
# Or a python dictionary
|
|
39
|
+
print(account.model_dump())
|
|
40
|
+
|
|
41
|
+
# pyke throws custom exceptions, again following the same conventions as the Riot API
|
|
42
|
+
# For example a request that responds with error code 429
|
|
43
|
+
# Will throw pyke.exceptions.RateLimitExceeded
|
|
44
|
+
try:
|
|
45
|
+
region = api.account.region_by_puuid(Continent.EUROPE, account.puuid)
|
|
46
|
+
except exceptions.RateLimitExceeded as e:
|
|
47
|
+
print(e) # Output: Rate limit exceeded (Error Code: 429)
|
|
48
|
+
quit()
|
|
49
|
+
|
|
50
|
+
# Members can be accessed with dot notation just like before
|
|
51
|
+
print(f"PUUID: {region.puuid}")
|
|
52
|
+
print(f"Game: {region.game}")
|
|
53
|
+
print(f"Region: {region.region}")
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
enjoy :)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyke-lol"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A Riot API wrapper specifically for League of Legends."
|
|
5
|
+
authors = [{ name = "diodemusic" }]
|
|
6
|
+
license = { text = "MIT" }
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
requires-python = ">=3.13"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"requests (>=2.32.5,<3.0.0)",
|
|
11
|
+
"python-dotenv (>=1.1.1,<2.0.0)",
|
|
12
|
+
"pytest (>=8.4.2,<9.0.0)",
|
|
13
|
+
"pydantic (>=2.11.10,<3.0.0)",
|
|
14
|
+
"datamodel-code-generator (>=0.34.0,<0.35.0)",
|
|
15
|
+
"pdoc (>=15.0.4,<16.0.0)",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
[build-system]
|
|
20
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
21
|
+
build-backend = "poetry.core.masonry.api"
|
|
22
|
+
|
|
23
|
+
[tool.poetry]
|
|
24
|
+
packages = [
|
|
25
|
+
{ include = "pyke", from = "src" }
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.pyright]
|
|
29
|
+
reportPrivateUsage = false
|
|
30
|
+
typeCheckingMode = "strict"
|
|
31
|
+
|
|
32
|
+
[tool.ruff.per-file-ignores]
|
|
33
|
+
"tests/*" = ["F401", "F811"]
|
|
34
|
+
|
|
35
|
+
[[tool.pyright.executionEnvironments]]
|
|
36
|
+
root = "tests"
|
|
37
|
+
reportUnusedImport = "none"
|
|
38
|
+
reportMissingTypeStubs = "none"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from . import exceptions
|
|
2
|
+
from .__version__ import __author__, __title__, __version__
|
|
3
|
+
from ._enums.continent import Continent
|
|
4
|
+
from ._enums.division import Division
|
|
5
|
+
from ._enums.level import Level
|
|
6
|
+
from ._enums.queue import Queue
|
|
7
|
+
from ._enums.region import Region
|
|
8
|
+
from ._enums.tier import Tier
|
|
9
|
+
from ._enums.type import Type
|
|
10
|
+
from .main import Pyke
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"exceptions",
|
|
14
|
+
"Continent",
|
|
15
|
+
"Division",
|
|
16
|
+
"Level",
|
|
17
|
+
"Queue",
|
|
18
|
+
"Region",
|
|
19
|
+
"Tier",
|
|
20
|
+
"Type",
|
|
21
|
+
"Pyke",
|
|
22
|
+
]
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import requests
|
|
4
|
+
|
|
5
|
+
from . import exceptions
|
|
6
|
+
from ._enums.continent import Continent
|
|
7
|
+
from ._enums.region import Region
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class _BaseApiClient: # pyright: ignore[reportUnusedClass]
|
|
11
|
+
CONTINENT_BASE = "https://{continent}.api.riotgames.com"
|
|
12
|
+
REGION_BASE = "https://{region}.api.riotgames.com"
|
|
13
|
+
|
|
14
|
+
def __init__(self, api_key: str | None):
|
|
15
|
+
self.api_key = api_key
|
|
16
|
+
|
|
17
|
+
def _get(self, url: str, params: dict[Any, Any] | None = None):
|
|
18
|
+
headers = {"X-Riot-Token": self.api_key}
|
|
19
|
+
response = requests.get(url, headers=headers, params=params)
|
|
20
|
+
|
|
21
|
+
rate_limit = (
|
|
22
|
+
response.headers.get("X-App-Rate-Limit", "").split(":")[0].replace(":", "/")
|
|
23
|
+
)
|
|
24
|
+
rate_limit_count = response.headers.get("X-App-Rate-Limit-Count", "").split(
|
|
25
|
+
":"
|
|
26
|
+
)[0]
|
|
27
|
+
print(f"({rate_limit_count}/{rate_limit}) - {url}")
|
|
28
|
+
|
|
29
|
+
code = response.status_code
|
|
30
|
+
|
|
31
|
+
if code == 400:
|
|
32
|
+
raise exceptions.BadRequest("Bad request", 400)
|
|
33
|
+
elif code == 401:
|
|
34
|
+
raise exceptions.Unauthorized("Unauthorized", 401)
|
|
35
|
+
elif code == 403:
|
|
36
|
+
raise exceptions.Forbidden("Forbidden", 403)
|
|
37
|
+
elif code == 404:
|
|
38
|
+
raise exceptions.DataNotFound("Data not found", 404)
|
|
39
|
+
elif code == 405:
|
|
40
|
+
raise exceptions.MethodNotAllowed("Method not allowed", 405)
|
|
41
|
+
elif code == 415:
|
|
42
|
+
raise exceptions.UnsupportedMediaType("Unsupported media type", 415)
|
|
43
|
+
elif code == 429:
|
|
44
|
+
raise exceptions.RateLimitExceeded("Rate limit exceeded", 429)
|
|
45
|
+
elif code == 500:
|
|
46
|
+
raise exceptions.InternalServerError("Internal server error", 500)
|
|
47
|
+
elif code == 502:
|
|
48
|
+
raise exceptions.BadGateway("Bad gateway", 502)
|
|
49
|
+
elif code == 503:
|
|
50
|
+
raise exceptions.ServiceUnavailable("Service unavailable", 503)
|
|
51
|
+
elif code == 504:
|
|
52
|
+
raise exceptions.GatewayTimeout("Gateway timeout", 504)
|
|
53
|
+
elif code == 200:
|
|
54
|
+
return response.json()
|
|
55
|
+
else:
|
|
56
|
+
print("Uncaught exception")
|
|
57
|
+
|
|
58
|
+
return response.json()
|
|
59
|
+
|
|
60
|
+
def _continent_request(
|
|
61
|
+
self, continent: Continent, path: str, params: dict[Any, Any] | None = None
|
|
62
|
+
):
|
|
63
|
+
url = f"{self.CONTINENT_BASE.format(continent=continent.value)}{path}"
|
|
64
|
+
return self._get(url, params)
|
|
65
|
+
|
|
66
|
+
def _region_request(
|
|
67
|
+
self, region: Region, path: str, params: dict[Any, Any] | None = None
|
|
68
|
+
):
|
|
69
|
+
url = f"{self.REGION_BASE.format(region=region.value)}{path}"
|
|
70
|
+
return self._get(url, params)
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Level(Enum):
|
|
5
|
+
"""# Challenge level"""
|
|
6
|
+
|
|
7
|
+
NONE = "NONE"
|
|
8
|
+
IRON = "IRON"
|
|
9
|
+
BRONZE = "BRONZE"
|
|
10
|
+
SILVER = "SILVER"
|
|
11
|
+
GOLD = "GOLD"
|
|
12
|
+
PLATINUM = "PLATINUM"
|
|
13
|
+
EMERALD = "EMERALD"
|
|
14
|
+
DIAMOND = "DIAMOND"
|
|
15
|
+
MASTER = "MASTER"
|
|
16
|
+
GRANDMASTER = "GRANDMASTER"
|
|
17
|
+
CHALLENGER = "CHALLENGER"
|
|
18
|
+
HIGHEST_NOT_LEADERBOARD_ONLY = "HIGHEST_NOT_LEADERBOARD_ONLY"
|
|
19
|
+
HIGHEST = "HIGHEST"
|
|
20
|
+
LOWEST = "LOWEST"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Region(Enum):
|
|
5
|
+
BR = "br1"
|
|
6
|
+
EUNE = "eun1"
|
|
7
|
+
EUW = "euw1"
|
|
8
|
+
JP = "JP1"
|
|
9
|
+
KR = "kr"
|
|
10
|
+
LAN = "la1"
|
|
11
|
+
LAS = "la2"
|
|
12
|
+
ME = "me1"
|
|
13
|
+
NA = "na1"
|
|
14
|
+
OCE = "oc1"
|
|
15
|
+
RU = "ru1"
|
|
16
|
+
TR = "tr1"
|
|
17
|
+
PH = "ph2"
|
|
18
|
+
SG = "sg2"
|
|
19
|
+
TH = "th2"
|
|
20
|
+
TW = "tw2"
|
|
21
|
+
VN = "vn2"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Tier(Enum):
|
|
5
|
+
IRON = "IRON"
|
|
6
|
+
BRONZE = "BRONZE"
|
|
7
|
+
SILVER = "SILVER"
|
|
8
|
+
GOLD = "GOLD"
|
|
9
|
+
PLATINUM = "PLATINUM"
|
|
10
|
+
EMERALD = "EMERALD"
|
|
11
|
+
DIAMOND = "DIAMOND"
|
|
12
|
+
MASTER = "MASTER"
|
|
13
|
+
GRANDMASTER = "GRANDMASTER"
|
|
14
|
+
CHALLENGER = "CHALLENGER"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: schema.json
|
|
3
|
+
# timestamp: 2025-10-09T19:10:06+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Status(BaseModel):
|
|
13
|
+
status_code: Optional[int] = None
|
|
14
|
+
message: Optional[str] = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Error(BaseModel):
|
|
18
|
+
status: Optional[Status] = None
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: schema.json
|
|
3
|
+
# timestamp: 2025-10-09T19:10:06+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AccountDto(BaseModel):
|
|
13
|
+
puuid: str = Field(
|
|
14
|
+
..., description="Encrypted PUUID. Exact length of 78 characters."
|
|
15
|
+
)
|
|
16
|
+
game_name: Optional[str] = Field(
|
|
17
|
+
None,
|
|
18
|
+
alias="gameName",
|
|
19
|
+
description="This field may be excluded from the response if the account doesn't have a gameName.",
|
|
20
|
+
)
|
|
21
|
+
tag_line: Optional[str] = Field(
|
|
22
|
+
None,
|
|
23
|
+
alias="tagLine",
|
|
24
|
+
description="This field may be excluded from the response if the account doesn't have a tagLine.",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AccountRegionDTO(BaseModel):
|
|
29
|
+
puuid: str = Field(
|
|
30
|
+
...,
|
|
31
|
+
description="Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted)",
|
|
32
|
+
)
|
|
33
|
+
game: str = Field(..., description="Game to lookup active region")
|
|
34
|
+
region: str = Field(..., description="Player active region")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ActiveShardDto(BaseModel):
|
|
38
|
+
puuid: str
|
|
39
|
+
game: str
|
|
40
|
+
active_shard: str = Field(..., alias="activeShard")
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: schema.json
|
|
3
|
+
# timestamp: 2025-10-09T19:10:06+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from typing import Dict, List, Optional
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel, Field
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class State(Enum):
|
|
14
|
+
disabled = "DISABLED"
|
|
15
|
+
hidden = "HIDDEN"
|
|
16
|
+
enabled = "ENABLED"
|
|
17
|
+
archived = "ARCHIVED"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Tracking(Enum):
|
|
21
|
+
lifetime = "LIFETIME"
|
|
22
|
+
season = "SEASON"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ChallengeConfigInfoDto(BaseModel):
|
|
26
|
+
id: int
|
|
27
|
+
localized_names: Dict[str, Dict[str, str]] = Field(..., alias="localizedNames")
|
|
28
|
+
state: State = Field(
|
|
29
|
+
...,
|
|
30
|
+
description="DISABLED - not visible and not calculated, HIDDEN - not visible, but calculated, ENABLED - visible and calculated, ARCHIVED - visible, but not calculated",
|
|
31
|
+
)
|
|
32
|
+
tracking: Optional[Tracking] = Field(
|
|
33
|
+
None,
|
|
34
|
+
description="LIFETIME - stats are incremented without reset, SEASON - stats are accumulated by season and reset at the beginning of new season",
|
|
35
|
+
)
|
|
36
|
+
start_timestamp: Optional[int] = Field(None, alias="startTimestamp")
|
|
37
|
+
end_timestamp: Optional[int] = Field(None, alias="endTimestamp")
|
|
38
|
+
leaderboard: bool
|
|
39
|
+
thresholds: Dict[str, float]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class StateModel(BaseModel):
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class TrackingModel(BaseModel):
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class ApexPlayerInfoDto(BaseModel):
|
|
51
|
+
puuid: str
|
|
52
|
+
value: float
|
|
53
|
+
position: int
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class Level(BaseModel):
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class LevelModel(Enum):
|
|
61
|
+
none = "NONE"
|
|
62
|
+
iron = "IRON"
|
|
63
|
+
bronze = "BRONZE"
|
|
64
|
+
silver = "SILVER"
|
|
65
|
+
gold = "GOLD"
|
|
66
|
+
platinum = "PLATINUM"
|
|
67
|
+
diamond = "DIAMOND"
|
|
68
|
+
master = "MASTER"
|
|
69
|
+
grandmaster = "GRANDMASTER"
|
|
70
|
+
challenger = "CHALLENGER"
|
|
71
|
+
highest_not_leaderboard_only = "HIGHEST_NOT_LEADERBOARD_ONLY"
|
|
72
|
+
highest = "HIGHEST"
|
|
73
|
+
lowest = "LOWEST"
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class ChallengeInfoDto(BaseModel):
|
|
77
|
+
percentile: float
|
|
78
|
+
players_in_level: Optional[int] = Field(None, alias="playersInLevel")
|
|
79
|
+
achieved_time: Optional[int] = Field(None, alias="achievedTime")
|
|
80
|
+
value: float
|
|
81
|
+
challenge_id: int = Field(..., alias="challengeId")
|
|
82
|
+
level: LevelModel = Field(
|
|
83
|
+
...,
|
|
84
|
+
description="(Legal values: NONE, IRON, BRONZE, SILVER, GOLD, PLATINUM, DIAMOND, MASTER, GRANDMASTER, CHALLENGER, HIGHEST_NOT_LEADERBOARD_ONLY, HIGHEST, LOWEST)",
|
|
85
|
+
)
|
|
86
|
+
position: Optional[int] = None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class PlayerClientPreferencesDto(BaseModel):
|
|
90
|
+
banner_accent: Optional[str] = Field(None, alias="bannerAccent")
|
|
91
|
+
title: Optional[str] = None
|
|
92
|
+
challenge_ids: Optional[List[int]] = Field(None, alias="challengeIds")
|
|
93
|
+
crest_border: Optional[str] = Field(None, alias="crestBorder")
|
|
94
|
+
prestige_crest_border_level: Optional[int] = Field(
|
|
95
|
+
None, alias="prestigeCrestBorderLevel"
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class ChallengePointDto(BaseModel):
|
|
100
|
+
level: str
|
|
101
|
+
current: int
|
|
102
|
+
max: int
|
|
103
|
+
percentile: Optional[float] = None
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class PlayerInfoDto(BaseModel):
|
|
107
|
+
challenges: List[ChallengeInfoDto]
|
|
108
|
+
preferences: PlayerClientPreferencesDto
|
|
109
|
+
total_points: ChallengePointDto = Field(..., alias="totalPoints")
|
|
110
|
+
category_points: Dict[str, ChallengePointDto] = Field(..., alias="categoryPoints")
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: schema.json
|
|
3
|
+
# timestamp: 2025-10-09T19:10:06+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Dict, List, Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RewardConfigDto(BaseModel):
|
|
13
|
+
reward_value: str = Field(..., alias="rewardValue", description="Reward value")
|
|
14
|
+
reward_type: str = Field(..., alias="rewardType", description="Reward type")
|
|
15
|
+
maximum_reward: int = Field(
|
|
16
|
+
..., alias="maximumReward", description="Maximun reward"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class NextSeasonMilestonesDto(BaseModel):
|
|
21
|
+
require_grade_counts: Dict[str, int] = Field(..., alias="requireGradeCounts")
|
|
22
|
+
reward_marks: int = Field(..., alias="rewardMarks", description="Reward marks.")
|
|
23
|
+
bonus: bool = Field(..., description="Bonus.")
|
|
24
|
+
reward_config: Optional[RewardConfigDto] = Field(
|
|
25
|
+
None, alias="rewardConfig", description="Reward configuration."
|
|
26
|
+
)
|
|
27
|
+
total_games_requires: int = Field(..., alias="totalGamesRequires")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ChampionMasteryDto(BaseModel):
|
|
31
|
+
puuid: str = Field(
|
|
32
|
+
...,
|
|
33
|
+
description="Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted)",
|
|
34
|
+
)
|
|
35
|
+
champion_points_until_next_level: int = Field(
|
|
36
|
+
...,
|
|
37
|
+
alias="championPointsUntilNextLevel",
|
|
38
|
+
description="Number of points needed to achieve next level. Zero if player reached maximum champion level for this champion.",
|
|
39
|
+
)
|
|
40
|
+
chest_granted: Optional[bool] = Field(
|
|
41
|
+
None,
|
|
42
|
+
alias="chestGranted",
|
|
43
|
+
description="Is chest granted for this champion or not in current season.",
|
|
44
|
+
)
|
|
45
|
+
champion_id: int = Field(
|
|
46
|
+
..., alias="championId", description="Champion ID for this entry."
|
|
47
|
+
)
|
|
48
|
+
last_play_time: int = Field(
|
|
49
|
+
...,
|
|
50
|
+
alias="lastPlayTime",
|
|
51
|
+
description="Last time this champion was played by this player - in Unix milliseconds time format.",
|
|
52
|
+
)
|
|
53
|
+
champion_level: int = Field(
|
|
54
|
+
...,
|
|
55
|
+
alias="championLevel",
|
|
56
|
+
description="Champion level for specified player and champion combination.",
|
|
57
|
+
)
|
|
58
|
+
champion_points: int = Field(
|
|
59
|
+
...,
|
|
60
|
+
alias="championPoints",
|
|
61
|
+
description="Total number of champion points for this player and champion combination - they are used to determine championLevel.",
|
|
62
|
+
)
|
|
63
|
+
champion_points_since_last_level: int = Field(
|
|
64
|
+
...,
|
|
65
|
+
alias="championPointsSinceLastLevel",
|
|
66
|
+
description="Number of points earned since current level has been achieved.",
|
|
67
|
+
)
|
|
68
|
+
mark_required_for_next_level: int = Field(..., alias="markRequiredForNextLevel")
|
|
69
|
+
champion_season_milestone: int = Field(..., alias="championSeasonMilestone")
|
|
70
|
+
next_season_milestone: NextSeasonMilestonesDto = Field(
|
|
71
|
+
..., alias="nextSeasonMilestone"
|
|
72
|
+
)
|
|
73
|
+
tokens_earned: int = Field(
|
|
74
|
+
...,
|
|
75
|
+
alias="tokensEarned",
|
|
76
|
+
description="The token earned for this champion at the current championLevel. When the championLevel is advanced the tokensEarned resets to 0.",
|
|
77
|
+
)
|
|
78
|
+
milestone_grades: Optional[List[str]] = Field(None, alias="milestoneGrades")
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: schema.json
|
|
3
|
+
# timestamp: 2025-10-09T19:10:06+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import List
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ChampionInfo(BaseModel):
|
|
13
|
+
max_new_player_level: int = Field(..., alias="maxNewPlayerLevel")
|
|
14
|
+
free_champion_ids_for_new_players: List[int] = Field(
|
|
15
|
+
..., alias="freeChampionIdsForNewPlayers"
|
|
16
|
+
)
|
|
17
|
+
free_champion_ids: List[int] = Field(..., alias="freeChampionIds")
|