def get_match_history(self, account_id=None, **kwargs): """Returns a dictionary containing a list of the most recent Dota matches :param account_id: (int, optional) :param hero_id: (int, optional) :param game_mode: (int, optional) see ``ref/modes.json`` :param skill: (int, optional) see ``ref/skill.json`` :param date_min: (int, optional) unix timestamp rounded to the nearest day :param date_max: (int, optional) unix timestamp rounded to the nearest day :param min_players: (int, optional) only return matches with minimum amount of players :param league_id: (int, optional) for ids use ``get_league_listing()`` :param start_at_match_id: (int, optional) start at matches equal to or older than this match id :param matches_requested: (int, optional) defaults to ``100`` :param tournament_games_only: (str, optional) limit results to tournament matches only :return: dictionary of matches, see :doc:`responses </responses>` """ if 'account_id' not in kwargs: kwargs['account_id'] = account_id url = self.__build_url(urls.GET_MATCH_HISTORY, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_league_listing(self): """Returns a dictionary containing a list of all ticketed leagues :return: dictionary of ticketed leagues, see :doc:`responses </responses>` """ url = self.__build_url(urls.GET_LEAGUE_LISTING) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_live_league_games(self): """Returns a dictionary containing a list of ticked games in progress :return: dictionary of live games, see :doc:`responses </responses>` """ url = self.__build_url(urls.GET_LIVE_LEAGUE_GAMES) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_game_items(self): """Returns a dictionary of in-game items, used to parse ids into localised names :return: dictionary of items, see :doc:`responses </responses>` """ url = self.__build_url(urls.GET_GAME_ITEMS) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_match_details(self, match_id=None, **kwargs): """Returns a dictionary containing the details for a Dota 2 match :param match_id: (int, optional) :return: dictionary of matches, see :doc:`responses </responses>` """ if 'match_id' not in kwargs: kwargs['match_id'] = match_id url = self.__build_url(urls.GET_MATCH_DETAILS, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_tournament_prize_pool(self, leagueid=None, **kwargs): """Returns a dictionary that includes community funded tournament prize pools :param leagueid: (int, optional) :return: dictionary of prize pools, see :doc:`responses </responses>` """ if 'leagueid' not in kwargs: kwargs['leagueid'] = leagueid url = self.__build_url(urls.GET_TOURNAMENT_PRIZE_POOL, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_player_summaries(self, steamids=None, **kwargs): """Returns a dictionary containing a player summaries :param steamids: (list) list of ``64-bit`` steam ids :return: dictionary of player summaries, see :doc:`responses </responses>` """ if 'steamids' not in kwargs: kwargs['steamids'] = steamids url = self.__build_url(urls.GET_PLAYER_SUMMARIES, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_team_info_by_team_id(self, start_at_team_id=None, **kwargs): """Returns a dictionary containing a in-game teams :param start_at_team_id: (int, optional) :param teams_requested: (int, optional) :return: dictionary of teams, see :doc:`responses </responses>` """ if 'start_at_team_id' not in kwargs: kwargs['start_at_team_id'] = start_at_team_id url = self.__build_url(urls.GET_TEAM_INFO_BY_TEAM_ID, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)
def get_match_history_by_seq_num(self, start_at_match_seq_num=None, **kwargs): """Returns a dictionary containing a list of Dota matches in the order they were recorded :param start_at_match_seq_num: (int, optional) start at matches equal to or older than this match id :param matches_requested: (int, optional) defaults to ``100`` :return: dictionary of matches, see :doc:`responses </responses>` """ if 'start_at_match_seq_num' not in kwargs: kwargs['start_at_match_seq_num'] = start_at_match_seq_num url = self.__build_url(urls.GET_MATCH_HISTORY_BY_SEQ_NUM, **kwargs) req = self.executor(url) if self.logger: self.logger.info('URL: {0}'.format(url)) if not self.__check_http_err(req.status_code): return response.build(req, url)