Team¶
Information for the Team
is taken from the following endpoint:
An example of what information a Team
(Manchester United) contains is shown below:
{
"id": 14,
"current_event_fixture": [
{
"is_home": true,
"month": 1,
"event_day": 1,
"id": 226,
"day": 19,
"opponent": 3
}
],
"next_event_fixture": [
{
"is_home": true,
"month": 1,
"event_day": 1,
"id": 235,
"day": 29,
"opponent": 4
}
],
"name": "Man Utd",
"code": 1,
"short_name": "MUN",
"unavailable": false,
"strength": 4,
"position": 0,
"played": 0,
"win": 0,
"loss": 0,
"draw": 0,
"points": 0,
"form": null,
"link_url": "",
"strength_overall_home": 1280,
"strength_overall_away": 1290,
"strength_attack_home": 1250,
"strength_attack_away": 1260,
"strength_defence_home": 1310,
"strength_defence_away": 1340,
"team_division": 1
}
-
class
fpl.models.team.
Team
(team_information, session)[source]¶ A class representing a real team in the Fantasy Premier League.
Basic usage:
from fpl import FPL import aiohttp import asyncio >>> async def main(): async with aiohttp.ClientSession() as session: fpl = FPL(session) team = await fpl.get_team(14) print(team) ... # Python 3.7+ asyncio.run(main()) ... # Python 3.6 loop = asyncio.get_event_loop() loop.run_until_complete(main()) Man Utd
-
get_fixtures
(return_json=False)[source]¶ Returns a list containing the team’s fixtures.
Parameters: return_json (bool) – (optional) Boolean. If True
returns a list of dicts, ifFalse
returns a list of TeamFixture objects. Defaults toFalse
.Return type: list
-
get_players
(return_json=False)[source]¶ Returns a list containing the players who play for the team. Does not include the player’s summary.
Parameters: return_json (bool) – (optional) Boolean. If True
returns a list of dicts, ifFalse
returns a list of Player objects. Defaults toFalse
.Return type: list
-