From 6b3fd5c21640a761673dbb6a9631a3830480aa48 Mon Sep 17 00:00:00 2001 From: "Y.W" Date: Mon, 17 Apr 2017 18:21:47 -0700 Subject: [PATCH 1/2] Modify get_team_info_by_team_id By adding a new api call GET_TEAM_INFO --- dota2api/__init__.py | 14 ++++++++++++++ dota2api/src/urls.py | 1 + 2 files changed, 15 insertions(+) diff --git a/dota2api/__init__.py b/dota2api/__init__.py index 7ce85e2..d57f988 100644 --- a/dota2api/__init__.py +++ b/dota2api/__init__.py @@ -161,6 +161,20 @@ def get_team_info_by_team_id(self, start_at_team_id=None, **kwargs): if not self.__check_http_err(req.status_code): return response.build(req, url, self.raw_mode) + def get_team_info(self, team_id=None, **kwargs): + """Returns a team's info + + :param team_id: team's id + """ + if 'team_id' not in kwargs: + kwargs['team_id'] = team_id + url = self.__build_url(urls.GET_TEAM_INFO, **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 diff --git a/dota2api/src/urls.py b/dota2api/src/urls.py index ed526c9..d6a1803 100644 --- a/dota2api/src/urls.py +++ b/dota2api/src/urls.py @@ -9,6 +9,7 @@ GET_LEAGUE_LISTING = "IDOTA2Match_570/GetLeagueListing/v0001/" GET_LIVE_LEAGUE_GAMES = "IDOTA2Match_570/GetLiveLeagueGames/v0001/" GET_TEAM_INFO_BY_TEAM_ID = "IDOTA2Match_570/GetTeamInfoByTeamID/v001/" +GET_TEAM_INFO = "IDOTA2Teams_570/GetTeamInfo/v001/" GET_PLAYER_SUMMARIES = "ISteamUser/GetPlayerSummaries/v0002/" GET_HEROES = "IEconDOTA2_570/GetHeroes/v0001/" GET_GAME_ITEMS = "IEconDOTA2_570/GetGameItems/v0001/" From 627dd0f38123d1b9433c0f66251eb86a04ff5330 Mon Sep 17 00:00:00 2001 From: "Y.W" Date: Mon, 17 Apr 2017 18:24:54 -0700 Subject: [PATCH 2/2] add get_team_info --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 42e2e58..b17870b 100644 --- a/README.rst +++ b/README.rst @@ -67,6 +67,7 @@ Supported API calls - get_league_listing - get_live_league_games - get_team_info_by_team_id +- get_team_info - get_heroes - get_tournament_prize_pool - get_game_items