understatapi.endpoints.team module¶
Team endpoint
-
class
understatapi.endpoints.team.TeamEndpoint(team, session)[source]¶ Bases:
understatapi.endpoints.base.BaseEndpointUse this class to get data from a url of the form
https://understat.com/team/<team>/<season>- Example
>>> session = requests.Session() >>> team_names = ["Manchester_United", "Liverpool"] >>> for team in TeamEndpoint(team_names, session=session): ... print(team.team) Manchester_United Liverpool
-
parser: understatapi.parsers.base.BaseParser = <understatapi.parsers.team.TeamParser object>¶
-
__init__(team, session)[source]¶ - Parameters
team (
Union[List[str],str]) – Name of the team(s) to get data forsession (
Session) – The current session
-
property
team¶ team name
- Return type
Union[List[str],str]
-
_get_data(season, **kwargs)[source]¶ Get data on a per-team basis
- Parameters
season (
str) – Season to get data forkwargs (
str) – Keyword argument to pass tounderstatapi.endpoints.base.BaseEndpoint._request_url()
- Return type
Response
-
get_player_data(season, **kwargs)[source]¶ Get data for all players on a given team in a given season
- Parameters
season (
str) – Season to get data forkwargs (
str) – Keyword argument to pass tounderstatapi.endpoints.base.BaseEndpoint._get_response()
- Return type
Dict[str,Any]