Full API Reference¶
Welcome to the full API reference, here you can find the specific documentation for every public function in PyDrake. This section of the documentation is organised into Riot’s API interfaces.
The PyDrake Class¶
-
class
pydrake.
PyDrake
(api_key, rate_limit_mode='hard', show_rate_limit_warnings=False)¶ PyDrake is the main API wrapper class that will be used to call all Riot Games API functions
Parameters: - api_key – Your Riot Games API Key (to retrieve this, see API Keys)
- rate_limit_mode – The rate-limiting mode to use. Defaults to hard.
Can be set to:
+———-+—————————————————————+
|
soft
| | PyDrake will attempt to execute a request, on receiving a | | | | 429 response code it will wait the amount of time specified | | | | in the Retry-After response header | +———-+—————————————————————+ |hard
| | PyDrake will raise a RateLimitError on receiving a 429 | | | | response code | +———-+—————————————————————+ - show_rate_limit_warnings – Determines whether or not a RateLimitWarning will be shown when the program has to wait for a rate limit. Defaults to False.
-
get_champion_by_id
¶
-
get_match_from_matchlist
(match)¶ Retrieves the full data for a match from an item in a MatchList object
Parameters: match – The entry from a MatchList object to retrieve further data for Returns: a pydrake.matchv4.Match
object containing all of the data about the match
-
get_ranked_summoner
(summoner)¶ Retrieves the ranking information for the given summoner and returns a RankedSummoner object containing the new information
Parameters: summoner – The old summoner object to extend Returns: A pydrake.leaguev4.RankedSummoner
object
-
get_summoner_by_name
(name, region)¶ Retrieve statistics about a summoner which will be found by the given name.
Parameters: - name – The name of the summoner
- region – The region code that the account belongs to
Returns: A
pydrake.summonerv4.Summoner
object containing the parsed data from the APIWarning
Summoner names are case-sensitive
Note
For a full list of supported region codes, see Supported Region Codes.
-
get_summoner_matchlist
(summoner)¶ Retrieves the matchlist (recent match history ~150 games) for the given summoner
Parameters: summoner – The summoner to retrieve match data for Returns: A pydrake.matchv4.MatchList
object
Summoner-V4¶
League-V4¶
Match-V4¶
Data Dragon¶
-
class
pydrake.ddragon.
Champion
(data)¶ Encapsulates information about a Champion from the Data Dragon API
Variables: - id – The Champion’s ID
- name – The Champion’s name (e.g. Kai’Sa)
- title – The Champion’s title (e.g. Daughter of the Void)
- blurb – The Champion’s description
Warning
This should only be created through
pydrake.PyDrake.get_champion_by_id()
-
pydrake.ddragon.
get_champion_by_id
(id)¶ Retrieves a Champion object from the Riot database with the given ID
Parameters: id – the ID of the champion. Returns: a pydrake.ddragon.Champion
object with the given IDWarning
This should only be called through
pydrake.PyDrake.get_champion_by_id()
Supported Region Codes¶
Region | Code |
---|---|
Brazil | br1 |
Europe West | euw1 |
Europe Nordic & East | eun1 |
Japan | jp1 |
Korea | kr1 |
Latin America North | la1 |
Latin America South | la2 |
North America | na , na1 |
Oceania | oc1 |
Turkey | tr1 |
Russia | ru |
Public Beta | pbe1 |
Note
The NA region has two associated platform values - NA and NA1. Older summoners will have the NA platform associated with their account, while newer summoners will have the NA1 platform associated with their account.