Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Add a new api call using IDOTA2Teams_570/GetTeamInfo/ #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions dota2api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions dota2api/src/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down