API Reference¶
This section is the bulk of the documentation and includes all objects that will interact with the API.
Client¶
-
class
lol.
Client
(token: str, default_request_region: lol.enums.Region = <Region.NA1: 'na1'>, session: aiohttp.client.ClientSession = None, loop=None)[source]¶ Adds most of the base functionality for the module. Allows you interact and get things to interact with the API.
Parameters: - token (
str
) – The token to use when requesting the API. - default_request_region (Optional[
Region
]) – The region to request when no other region is supplied. Defaults toRegion.NA1
. - session (Optional[
aiohttp.ClientSession
]) – Used to supply a session if you dont want the Client creating it’s own. - loop (Optional[
asyncio.AbstractEventLoop
]) – Used to supply a loop if you dont want the Client usingasyncio.get_event_loop()
-
loop
¶ The used event loop.
Type: asyncio.AbstractEventLoop
-
default_request_region
¶ The region to request when no other region is supplied.
Type: lol.Region
-
coroutine
close
(close_loop=False)[source]¶ This is used to close the session, which will disable all functionality.
Parameters: close_loop ( bool
) – This is used to decide whether or not to close the event loop. Defaults to False.
-
coroutine
fetch_summoner
(id=None, puuid=None, account_id=None, name=None, region: lol.enums.Region = None)[source]¶ This is used to get a
Summoner
. It requires only one of the parameters (not including region) to get a summoner.Parameters: - id (
str
) – The id to search by. - puuid (
str
) – The puuid to search by. - account_id (
str
) – The id to search by. - id – The id to search by.
Returns: - Will return the summoner or will return None and raise
and error if the summoner couldn’t be found.
Return type: (Optional[
Summoner
])Raises: DataNotFound – No summoner with that information was found.
- id (
- token (
Summoner¶
-
class
lol.
Summoner
(client, region: lol.enums.Region, **data)[source]¶ Represents a League of Legends summoner.
-
name
¶ The name of the summoner.
Type: str
-
puuid
¶ The PUUID associated with the summoner.
Type: str
-
level
¶ The current level for the summoner.
Type: int
-
id
¶ The ID associated with the summoner.
Type: str
-
account_id
¶ The account ID associated with the summoner.
Type: str
-
revision_date
¶ The last time the summoner’s data was updated. This is server-side, keep in mind.
Type: datetime.datetime
-
profile_icon_id
¶ The ID for the summoner’s profile icon.
Type: int
-
profile_icon
¶ An Image which gives functionality for saving, reading, and accessing the url of the image.
Type: Image
-
region
¶ The region the summoner is located in.
Type: Region
-
Media¶
-
class
lol.
Image
(client, url)[source]¶ Adds functionality for images in the module.
-
url
¶ The URL/location of the image which is used when reading and saving. It is also for use when you only needed the URL of the image.
Type: str
Parameters: - client (
Client
) – The client responsible for the image’s creation and future requests. - url (
str
) – The URL/location of the image which is used when reading and saving.
-