TimelineCrawler class

class zilean.TimelineCrawler.TimelineCrawler(api_key: Optional[str] = None, region: Optional[str] = None, tier: Optional[str] = None, queue: Optional[str] = None, dummy_watcher=None)

Bases: object

An automatic crawler for Riot MatchTimelineDto s. The Riot MatchTimelineDto s contain stats of a match at each minute mark. The crawler runs riotwatcher.LolWatcher under the hood.

api_key

Your Riot API key. You must have a valid API key to access information through the Riot API. Defaults to None.

Type

str

region

The region of interest, defaults to None.

Type

str

tier

Tier level of the matches, defaults to None.

Type

str

queue

The queue type of the matches, defaults to None.

Type

str

dummy_watcher

For testing purpose only, defaults to None.

Type

DummyWatcher

Notes

The available options for region are

>>> ["br1", "eun1", "euw1", "jp1", "kr", "la1", "la2",
...  "na1", "oc1", "ru", "tr1"]

The available options for tier are

>>> ["CHALLENGER", "GRANDMASTER", "MASTER",
...  "DIAMOND", "PLATINUM", "GOLD", "SILVER",
...  "BRONZE", "IRON"]

The available options for queue are

>>> ["RANKED_SOLO_5x5", "RANKED_FLEX_SR",
...  "RANKED_FLEX_TT"]
crawl(n: int, match_per_id: int = 15, file: Optional[str] = None, cutoff: int = 16) list

Crawl MatchTimelineDto s and save results to disk as a json file. Also, return a list of unique MatchTimelineDto s. Each MatchTimelineDto is a dictionary that contains game statistics at each minute mark. To perform analysis, feed the returned list to a zilean.SnapShots object.

Parameters
  • n (int) – The number of unique matches to be crawled.

  • march_per_id (int) – The number of matches to be crawled for each unique account. Recommend to be a minimum of 15. Will handle the case if a player have played for less than the specified number of matches. Defaults to 15.

  • file (str) – The name of the file to write the crawled result. If None, then result will not be saved to disk. Defaults to None.

  • cutoff (int) – The mininum number of minutes required for a match to be counted toward the final list. Defaults to 16.

Returns

A list of MatchTimelineDto s.

Return type

list

queue_options_ = ['RANKED_SOLO_5x5', 'RANKED_FLEX_SR', 'RANKED_FLEX_TT']
region_options_ = ['br1', 'eun1', 'euw1', 'jp1', 'kr', 'la1', 'la2', 'na1', 'oc1', 'ru', 'tr1']
tier_options_ = ['CHALLENGER', 'GRANDMASTER', 'MASTER', 'DIAMOND', 'PLATINUM', 'GOLD', 'SILVER', 'BRONZE', 'IRON']