Beispiel #1
0
class Status(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder()

    def get_status(self, params=None):
        uri = self.uri.status.path()
        result = self.client.get(uri, params=params)

        return result

    def get_apiMetrics(self, params=None):
        uri = self.uri.admin.apiMetrics.path()
        result = self.client.get(uri, params=params)

        return result
Beispiel #2
0
class Explorer(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().explorer()

    def to_explorer(self, params=None):
        uri = self.uri.path()
        result = self.client.get(uri, params=params)

        return result
Beispiel #3
0
class Rankings(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().rankings()

    def get_rankings(self, params=None):
        uri = self.uri.path()
        result = self.client.get(uri, params=params)

        return result
Beispiel #4
0
class Distributions(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().distributions()

    def get_distributions(self):
        uri = self.uri.path()
        result = self.client.get(uri)

        return result
Beispiel #5
0
class Metadata(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().metadata()

    def get_metadata(self):
        uri = self.uri.path()
        result = self.client.get(uri)

        return result
Beispiel #6
0
class Search(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().search()

    def search(self, params=None):
        uri = self.uri.path()
        result = self.client.get(uri, params=params)

        return result
Beispiel #7
0
class Matches(object):
    def __init__(self, match_id=None):
        self.client = Client()
        self.match_id = match_id
        self.uri = api_builder().matches(int(self.match_id))

    def get_match(self):
        uri = self.uri.path()
        match = self.client.get(uri)
        print(match)
        return match
Beispiel #8
0
class ProMatches(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().proMatches.path()

    def get_all(self, params={'less_than_match_id': None}):
        matches = self.client.get(self.uri, params)
        for match in matches:
            # TODO save data
            m = ProMatch(match)
            print(m)
        return matches
Beispiel #9
0
class ProPlayers(object):
    def __init__(self):
        self.client = Client()
        self.uri = api_builder().proPlayers.path()

    def get_all(self):
        players = self.client.get(self.uri)
        for player in players:
            # TODO save data
            p = ProPlayer(player)

        return players
Beispiel #10
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().distributions()
Beispiel #11
0
class Players(object):
    def __init__(self, account_id=None):
        self.client = Client()
        self.account_id = account_id
        self.root_uri = api_builder().players(int(self.account_id))

    def get_player(self):
        uri = self.root_uri.path()
        player = self.client.get(uri)
        print(player)
        return player

    def get_player_wl(self, params=None):
        uri = self.root_uri.wl.path()
        player_wl = self.client.get(uri, params)
        print(player_wl)
        return player_wl

    def get_player_recentMatches(self):
        uri = self.root_uri.recentMatches.path()
        player_recentMatches = self.client.get(uri)
        print(player_recentMatches)
        return player_recentMatches

    def get_player_matches(self, params=None):
        uri = self.root_uri.matches.path()
        player_matches = self.client.get(uri, params)
        print(player_matches)
        return player_matches

    def get_player_heroes(self, params=None):
        uri = self.root_uri.heroes.path()
        player_heroes = self.client.get(uri, params)
        print(player_heroes)
        return player_heroes

    def get_player_peers(self, params=None):
        uri = self.root_uri.peers.path()
        player_peers = self.client.get(uri, params)
        print(player_peers)
        return player_peers

    def get_player_pros(self, params=None):
        uri = self.root_uri.pros.path()
        player_pros = self.client.get(uri, params)
        print(player_pros)
        return player_pros

    def get_player_totals(self, params=None):
        uri = self.root_uri.totals.path()
        player_totals = self.client.get(uri, params)
        print(player_totals)
        return player_totals

    def get_player_counts(self, params=None):
        uri = self.root_uri.totals.path()
        player_counts = self.client.get(uri, params)
        print(player_counts)
        return player_counts

    def get_player_histograms(self, field, params=None):
        uri = self.root_uri.histograms(field).path()
        player_histograms = self.client.get(uri, params)
        print(player_histograms)
        return player_histograms

    def get_player_wardmap(self, params=None):
        uri = self.root_uri.wardmap.path()
        player_wardmap = self.client.get(uri, params)
        print(player_wardmap)
        return player_wardmap

    def get_player_wordcloud(self, params=None):
        uri = self.root_uri.wordcloud.path()
        player_wordcloud = self.client.get(uri, params)
        print(player_wordcloud)
        return player_wordcloud

    def get_player_ratings(self):
        uri = self.root_uri.ratings.path()
        player_ratings = self.client.get(uri)
        print(player_ratings)
        return player_ratings

    def get_player_rankings(self):
        uri = self.root_uri.rankings.path()
        player_rankings = self.client.get(uri)
        print(player_rankings)
        return player_rankings

    def post_player_refesh(self):
        uri = self.root_uri.refresh.path()
        player_refresh = self.client.post(uri)
        print(player_refresh)
        return player_refresh
Beispiel #12
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().metadata()
Beispiel #13
0
 def __init__(self, account_id=None):
     self.client = Client()
     self.account_id = account_id
     self.root_uri = api_builder().players(int(self.account_id))
Beispiel #14
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().rankings()
Beispiel #15
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().benchmarks()
Beispiel #16
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().explorer()
Beispiel #17
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().proMatches.path()
Beispiel #18
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().proPlayers.path()
Beispiel #19
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().health()
Beispiel #20
0
 def __init__(self):
     self.client = Client()
     self.uri = api_builder().search()
Beispiel #21
0
 def __init__(self, match_id=None):
     self.client = Client()
     self.match_id = match_id
     self.uri = api_builder().matches(int(self.match_id))