Fixture¶
- Information for the
Fixture
is taken from e.g. the following endpoints: - https://fantasy.premierleague.com/api/fixtures/ https://fantasy.premierleague.com/api/fixtures/?event=1
An example of what information a Fixture
contains is shown below:
{
"code": 2128288,
"event": 1,
"finished": false,
"finished_provisional": false,
"id": 2,
"kickoff_time": "2020-09-12T11:30:00Z",
"minutes": 0,
"provisional_start_time": false,
"started": false,
"team_a": 1,
"team_a_score": null,
"team_h": 8,
"team_h_score": null,
"stats": [
],
"team_h_difficulty": 3,
"team_a_difficulty": 2
}
Basic usage:
from fpl import FPL
import aiohttp
import asyncio
async def main():
async with aiohttp.ClientSession() as session:
fpl = FPL(session)
fixture = await fpl.get_fixture(3)
print(fixture)
# Python 3.7+
asyncio.run(main())
...
# Python 3.6
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
# Liverpool vs. Leeds - Sat 12 Sep 16:30
-
class
fpl.models.fixture.
Fixture
(fixture_information)[source]¶ A class representing a fixture in Fantasy Premier League.
-
get_bonus
(provisional=False)[source]¶ Returns all players who received bonus points in the fixture.
Return type: dict
-
get_own_goalscorers
()[source]¶ Returns all players who scored an own goal in the fixture.
Return type: dict
-
get_penalty_misses
()[source]¶ Returns all players who missed a penalty in the fixture.
Return type: dict
-
get_penalty_saves
()[source]¶ Returns all players who saved a penalty in the fixture.
Return type: dict
-