premier_league_api package

Submodules

premier_league_api.client module

API Client for requests

class premier_league_api.client.APIClient[source]

Bases: object

Main api client that handles making all the requests and classes

get_fixture(fixture_id: int, language_code: str = 'EN') FixtureResult[source]

Get a fixture by ID

Parameters
  • fixture_id (int) – Id of the fixture to get

  • language_code (str) – Language code to get. Note: Changing to anything but EN seems to leave the Fixture events blank

Returns

Fixture

Return type

FixtureResult

get_fixtures(season_id: int, gameweek: Optional[int] = None) List[GameWeekFixture][source]

Get a list of all the fixtures in a season/gameweek

Parameters
  • season_id (int) – Season ID to get fixtures for

  • gameweek – Gameweek to get fixtures for. If left out will return the entire season

Returns

List of GameWeekFixture

Return type

List[GameWeekFixture]

get_gameweek(season_id: int, gameweek: int, matches_per_week: int = 10) List[GameWeekFixture][source]

Get fixtures for a specific gameweek of the season

Parameters
  • season_id (str) – Season ID of the season that the gameweek took place in

  • gameweek (int) – Number of the game week to get

  • matches_per_week (int) – How many matches there are per game week. It should be equal to half the amount of teams. Elimination tournaments will be tricky

Returns

List of matches

Return type

List[GameWeekFixture]

get_gameweeks(season_id: int) List[GameWeeks][source]

Get gameweeks for a season

Parameters

season_id (int) – Id of the season

Returns

Gameweeks in the season

Return type

List[GameWeeks]

get_player(player_id: int, comp_id: Optional[int] = None, season_id: Optional[int] = None, generate_stats: bool = False) Player[source]

Get a player by their ID

Parameters
  • generate_stats (bool) – Generate the stats for the player. Defaults to false

  • player_id (int) – ID of the player

  • comp_id – Competition ID of the competition to get stats for

  • season_id – Season ID to get stats for. You can use this without competition ID

Returns

The player

Return type

Player

get_teams_in_season(season_id: int) List[Team][source]

Get all the teams that are taking part in a season

Parameters

season_id (int) – Season ID to get

Returns

List of teams for the season

Return type

List[Team]

search_player(player_name: str, league_name: str = 'PremierLeague') List[SearchPlayer][source]

Searches for a player by a name

Parameters
  • player_name (str) – Full or partial name of the player

  • league_name (str) –

Returns

Possible matches. Max length of 30

Todo: Implement pagination for results

premier_league_api.competitions module

DO NOT MANUALLY EDIT. FILE AUTOMATICALLY GENERATED BY meta_competitions.py GENERATED AT: 2022-09-13 21:53:31.539378

class premier_league_api.competitions.ACC[source]

Bases: object

Class for Arnold Clark Cup

abbreviation = 'ACC'
description = 'Arnold Clark Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2212
level = 'SEN'
seasons = {'Arnold Clark Cup Season 2021/2022': 474}
source = ''
class premier_league_api.competitions.AFAPL[source]

Bases: object

Class for U18 Premier League

abbreviation = 'AFAPL'
description = 'U18 Premier League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 8
level = 'U18'
seasons = {'2011/12': 50, '2012/13': 51, '2013/14': 44, '2014/15': 48, '2015/16': 35, '2016/17': 60, '2017/18': 89, '2018/19': 220, '2019/20': 296, '2020/21': 378, '2021/22': 434, '2022/23': 514}
source = ''
class premier_league_api.competitions.AFAPL12[source]

Bases: object

Class for U18 Professional Development League

abbreviation = 'AFAPL12'
description = 'U18 Professional Development League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 7
level = 'U18'
seasons = {'2014/15': 45, '2015/16': 34, '2016/17': 64, '2017/18': 93, '2018/19': 223, '2019/20': 300, '2020/21': 381, '2021/22': 450, 'English U18 Professional Development League Season 2022/2023': 518}
source = ''
class premier_league_api.competitions.AU_DI[source]

Bases: object

Class for Audi Cup

abbreviation = 'AU_DI'
description = 'Audi Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 31
level = 'SEN'
seasons = {'Audi Cup Season 2013/2014': 174, 'Audi Cup Season 2015/2016': 175}
source = 'None'
class premier_league_api.competitions.BE_JL[source]

Bases: object

Class for Belgian Jupiler Pro League

abbreviation = 'BE_JL'
description = 'Belgian Jupiler Pro League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 658
level = 'SEN'
seasons = {'Belgian Jupiler Pro League Season 2020/2021': 389, 'Belgian Jupiler Pro League Season 2021/2022': 416, 'Belgian Jupiler Pro League Season 2022/2023': 500}
source = ''
class premier_league_api.competitions.DE_RN[source]

Bases: object

Class for German Regionalliga Nord

abbreviation = 'DE_RN'
description = 'German Regionalliga Nord'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 657
level = 'SEN'
seasons = {'German Regionalliga Nord Season 2020/2021': 388}
source = ''
class premier_league_api.competitions.EC_SC[source]

Bases: object

Class for Supercopa de Ecuador

abbreviation = 'EC_SC'
description = 'Supercopa de Ecuador'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 373
level = 'SEN'
seasons = {'Supercopa de Ecuador Season 2019/2020': 337, 'Supercopa de Ecuador Season 2020/2021': 401}
source = ''
class premier_league_api.competitions.EN_17[source]

Bases: object

Class for U17 Premier League Cup

abbreviation = 'EN_17'
description = 'U17 Premier League Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2096
level = 'SEN'
seasons = {'English U17 Premier League Cup Season 2021/2022': 462, 'English U17 Premier League Cup Season 2022/2023': 533}
source = ''
class premier_league_api.competitions.EN_CN[source]

Bases: object

Class for English National North

abbreviation = 'EN_CN'
description = 'English National North'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 389
level = 'SEN'
seasons = {'English National North Season 2019/2020': 354}
source = ''
class premier_league_api.competitions.EN_CP[source]

Bases: object

Class for English National League

abbreviation = 'EN_CP'
description = 'English National League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 388
level = 'SEN'
seasons = {'English National League Season 2019/2020': 353}
source = ''
class premier_league_api.competitions.EN_CS[source]

Bases: object

Class for English National South

abbreviation = 'EN_CS'
description = 'English National South'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 390
level = 'SEN'
seasons = {'English National South Season 2019/2020': 355}
source = ''
class premier_league_api.competitions.EN_D1[source]

Bases: object

Class for English Football League - Championship

abbreviation = 'EN_D1'
description = 'English Football League - Championship'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 12
level = 'SEN'
seasons = {'1996/97': 73, '2009/10': 108, '2010/11': 109, '2011/12': 103, '2012/13': 104, '2013/14': 105, '2014/15': 264, '2016/17': 55, '2017/18': 83, '2018/19': 211, '2019/20': 276, 'English Football League - Championship Season 2020/2021': 362, 'English Football League - Championship Season 2021/2022': 426, 'English Football League - Championship Season 2022/2023': 502}
source = ''
class premier_league_api.competitions.EN_D2[source]

Bases: object

Class for English Football League - League One

abbreviation = 'EN_D2'
description = 'English Football League - League One'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 20
level = 'SEN'
seasons = {'English Football League - League One Season 2008/2009': 110, 'English Football League - League One Season 2013/2014': 263, 'English Football League - League One Season 2016/2017': 348, 'English Football League - League One Season 2017/2018': 349, 'English Football League - League One Season 2018/2019': 257, 'English Football League - League One Season 2019/2020': 278, 'English Football League - League One Season 2020/2021': 372, 'English Football League - League One Season 2021/2022': 427, 'English Football League - League One Season 2022/2023': 503}
source = ''
class premier_league_api.competitions.EN_D3[source]

Bases: object

Class for English Football League - League Two

abbreviation = 'EN_D3'
description = 'English Football League - League Two'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 43
level = 'SEN'
seasons = {'English Football League - League Two Season 2017/2018': 350, 'English Football League - League Two Season 2018/2019': 258, 'English Football League - League Two Season 2019/2020': 277, 'English Football League - League Two Season 2020/2021': 371, 'English Football League - League Two Season 2021/2022': 428, 'English Football League - League Two Season 2022/2023': 504}
source = ''
class premier_league_api.competitions.EN_DC[source]

Bases: object

Class for U18 Professional Development League Cup

abbreviation = 'EN_DC'
description = 'U18 Professional Development League Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2088
level = 'U18'
seasons = {'2021/22': 460, 'English U18 Professional Development League Cup Season 2022/2023': 529}
source = ''
class premier_league_api.competitions.EN_FA[source]

Bases: object

Class for FA Cup

abbreviation = 'EN_FA'
description = 'FA Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 4
level = 'SEN'
seasons = {'2004/05': 74, '2005/06': 205, '2006/07': 206, '2007/08': 207, '2008/09': 106, '2009/10': 107, '2010/11': 57, '2011/12': 76, '2012/13': 77, '2013/14': 25, '2014/15': 30, '2015/16': 32, '2016/17': 71, '2017/18': 85, '2018/19': 230, '2019/20': 328, '2020/21': 390, '2021/22': 466}
source = ''
class premier_league_api.competitions.EN_FC[source]

Bases: object

Class for English Community Shield

abbreviation = 'EN_FC'
description = 'English Community Shield'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 492
level = 'SEN'
seasons = {'2020/21': 379, '2021/22': 415, 'English Community Shield Season 2003/2004': 498, 'English Community Shield Season 2022/2023': 483}
source = ''
class premier_league_api.competitions.EN_FL[source]

Bases: object

Class for EFL Trophy

abbreviation = 'EN_FL'
description = 'EFL Trophy'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 13
level = 'U21'
seasons = {'2016/17': 69, '2017/18': 86, '2018/19': 224, '2019/20': 293, '2020/21': 370, '2021/22': 439, 'English Football League Trophy Season 2022/2023': 508}
source = ''
class premier_league_api.competitions.EN_LC[source]

Bases: object

Class for EFL Cup

abbreviation = 'EN_LC'
description = 'EFL Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 5
level = 'SEN'
seasons = {'2008/09': 111, '2009/10': 112, '2010/11': 58, '2011/12': 102, '2012/13': 78, '2013/14': 26, '2014/15': 28, '2015/16': 40, '2016/17': 56, '2017/18': 82, '2018/19': 212, '2019/20': 279, '2020/21': 368, '2021/22': 429, 'English League Cup Season 2007/2008': 472, 'English League Cup Season 2022/2023': 505}
source = ''
class premier_league_api.competitions.EN_PC[source]

Bases: object

Class for Premier League Cup

abbreviation = 'EN_PC'
description = 'Premier League Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 9
level = 'U21'
seasons = {'2014/15': 53, '2015/16': 36, '2016/17': 67, '2017/18': 97, '2018/19': 228, '2019/20': 315, '2021/22': 455, 'English Premier League Cup Season 2022/2023': 523}
source = ''
class premier_league_api.competitions.EN_PD[source]

Bases: object

Class for Professional Development League

abbreviation = 'EN_PD'
description = 'Professional Development League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 6
level = 'U21'
seasons = {'2014/15': 47, '2015/16': 33, '2016/17': 62, '2017/18': 91, '2018/19': 226, '2019/20': 298, '2020/21': 377, '2021/22': 449, 'English Professional Development League Season 2022/2023': 517}
source = ''
class premier_league_api.competitions.EN_PLIC[source]

Bases: object

Class for Premier League International Cup

abbreviation = 'EN_PLIC'
description = 'Premier League International Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 10
level = 'U21'
seasons = {'2014/15': 49, '2015/16': 38, '2016/17': 68, '2017/18': 95, '2018/19': 222, '2019/20': 314, 'Premier League International Cup Season 2022/2023': 519}
source = ''
class premier_league_api.competitions.EN_PR[source]

Bases: object

Class for Premier League

abbreviation = 'EN_PR'
description = 'Premier League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 1
level = 'SEN'
seasons = {'1992/93': 1, '1993/94': 2, '1994/95': 3, '1995/96': 4, '1996/97': 5, '1997/98': 6, '1998/99': 7, '1999/00': 8, '2000/01': 9, '2001/02': 10, '2002/03': 11, '2003/04': 12, '2004/05': 13, '2005/06': 14, '2006/07': 15, '2007/08': 16, '2008/09': 17, '2009/10': 18, '2010/11': 19, '2011/12': 20, '2012/13': 21, '2013/14': 22, '2014/15': 27, '2015/16': 42, '2016/17': 54, '2017/18': 79, '2018/19': 210, '2019/20': 274, '2020/21': 363, '2021/22': 418, '2022/23': 489}
source = ''
class premier_league_api.competitions.EN_RE[source]

Bases: object

Class for Premier League 2

abbreviation = 'EN_RE'
description = 'Premier League 2'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 11
level = 'U21'
seasons = {'2012/13': 52, '2013/14': 43, '2014/15': 46, '2015/16': 39, '2016/17': 59}
source = 'None'
class premier_league_api.competitions.EN_WC[source]

Bases: object

Class for English Women’s Community Shield

abbreviation = 'EN_WC'
description = "English Women's Community Shield"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 480
level = 'SEN'
seasons = {"English Women's Community Shield Season 2020/2021": 373}
source = ''
class premier_league_api.competitions.EN_YP[source]

Bases: object

Class for English FA Youth Cup

abbreviation = 'EN_YP'
description = 'English FA Youth Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 35
level = 'U18'
seasons = {'2015/16': 343, '2016/17': 344, '2017/18': 323, '2018/19': 232, '2019/20': 331, '2020/21': 393, 'English FA Youth Cup Season 2021/2022': 469}
source = ''
class premier_league_api.competitions.ES_CR[source]

Bases: object

Class for Copa Del Rey

abbreviation = 'ES_CR'
description = 'Copa Del Rey'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 25
level = 'SEN'
seasons = {'Spanish Copa Del Rey Season 2010/2011': 145, 'Spanish Copa Del Rey Season 2011/2012': 180, 'Spanish Copa Del Rey Season 2012/2013': 181, 'Spanish Copa Del Rey Season 2013/2014': 146, 'Spanish Copa Del Rey Season 2014/2015': 182, 'Spanish Copa Del Rey Season 2015/2016': 148, 'Spanish Copa Del Rey Season 2016/2017': 183, 'Spanish Copa Del Rey Season 2017/2018': 194, 'Spanish Copa Del Rey Season 2018/2019': 219, 'Spanish Copa Del Rey Season 2019/2020': 327, 'Spanish Copa Del Rey Season 2020/2021': 392, 'Spanish Copa Del Rey Season 2021/2022': 467, 'Spanish Copa Del Rey Season 2022/2023': 522}
source = ''
class premier_league_api.competitions.ES_CRA[source]

Bases: object

Class for Spanish Copa de la Reina

abbreviation = 'ES_CRA'
description = 'Spanish Copa de la Reina'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 669
level = 'SEN'
seasons = {'Spanish Copa de la Reina Season 2019/2020': 396, 'Spanish Copa de la Reina Season 2020/2021': 406, 'Spanish Copa de la Reina Season 2021/2022': 465, 'Spanish Copa de la Reina Season 2022/2023': 531}
source = ''
class premier_league_api.competitions.ES_CT[source]

Bases: object

Class for Supercopa de Catalunya

abbreviation = 'ES_CT'
description = 'Supercopa de Catalunya'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 33
level = 'SEN'
seasons = {'Supercopa de Catalunya Season 2016/2017': 177, 'Supercopa de Catalunya Season 2017/2018': 198, 'Supercopa de Catalunya Season 2018/2019': 241}
source = ''
class premier_league_api.competitions.ES_JG[source]

Bases: object

Class for Trofeo Joan Gamper

abbreviation = 'ES_JG'
description = 'Trofeo Joan Gamper'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 32
level = 'SEN'
seasons = {'Trofeo Joan Gamper Season 2016/2017': 176, 'Trofeo Joan Gamper Season 2017/2018': 200, 'Trofeo Joan Gamper Season 2018/2019': 216, 'Trofeo Joan Gamper Season 2019/2020': 284, 'Trofeo Joan Gamper Season 2020/2021': 382, 'Trofeo Joan Gamper Season 2021/2022': 446, 'Trofeo Joan Gamper Season 2022/2023': 490}
source = ''
class premier_league_api.competitions.ES_PF[source]

Bases: object

Class for Primera División Femenina

abbreviation = 'ES_PF'
description = 'Primera División Femenina'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 349
level = 'SEN'
seasons = {'Primera División Femenina Season 2017/2018': 347, 'Primera División Femenina Season 2018/2019': 346, 'Primera División Femenina Season 2019/2020': 320, 'Primera División Femenina Season 2020/2021': 357, 'Primera División Femenina Season 2021/2022': 432, 'Primera División Femenina Season 2022/2023': 513}
source = ''
class premier_league_api.competitions.ES_PL[source]

Bases: object

Class for La Liga

abbreviation = 'ES_PL'
description = 'La Liga'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 21
level = 'SEN'
seasons = {'Spanish La Liga Season 2003/2004': 203, 'Spanish La Liga Season 2006/2007': 332, 'Spanish La Liga Season 2007/2008': 340, 'Spanish La Liga Season 2008/2009': 394, 'Spanish La Liga Season 2009/2010': 395, 'Spanish La Liga Season 2010/2011': 117, 'Spanish La Liga Season 2011/2012': 139, 'Spanish La Liga Season 2012/2013': 140, 'Spanish La Liga Season 2013/2014': 141, 'Spanish La Liga Season 2014/2015': 142, 'Spanish La Liga Season 2015/2016': 143, 'Spanish La Liga Season 2016/2017': 144, 'Spanish La Liga Season 2017/2018': 193, 'Spanish La Liga Season 2018/2019': 213, 'Spanish La Liga Season 2019/2020': 286, 'Spanish La Liga Season 2020/2021': 365, 'Spanish La Liga Season 2021/2022': 431, 'Spanish La Liga Season 2022/2023': 501}
source = ''
class premier_league_api.competitions.ES_SC[source]

Bases: object

Class for Supercopa

abbreviation = 'ES_SC'
description = 'Supercopa'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 23
level = 'SEN'
seasons = {'Spanish Supercopa Season 2010/2011': 125, 'Spanish Supercopa Season 2011/2012': 126, 'Spanish Supercopa Season 2012/2013': 127, 'Spanish Supercopa Season 2013/2014': 128, 'Spanish Supercopa Season 2014/2015': 129, 'Spanish Supercopa Season 2015/2016': 130, 'Spanish Supercopa Season 2016/2017': 131, 'Spanish Supercopa Season 2017/2018': 191, 'Spanish Supercopa Season 2018/2019': 215, 'Spanish Supercopa Season 2019/2020': 330, 'Spanish Supercopa Season 2020/2021': 398, 'Spanish Supercopa Season 2021/2022': 430, 'Spanish Supercopa Season 2022/2023': 492}
source = ''
class premier_league_api.competitions.ES_SD[source]

Bases: object

Class for Spanish Segunda Division

abbreviation = 'ES_SD'
description = 'Spanish Segunda Division'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 22
level = 'SEN'
seasons = {'Spanish Segunda Division Season 2010/2011': 118, 'Spanish Segunda Division Season 2011/2012': 119, 'Spanish Segunda Division Season 2012/2013': 120, 'Spanish Segunda Division Season 2013/2014': 121, 'Spanish Segunda Division Season 2014/2015': 122, 'Spanish Segunda Division Season 2015/2016': 123, 'Spanish Segunda Division Season 2016/2017': 124, 'Spanish Segunda Division Season 2017/2018': 190}
source = 'None'
class premier_league_api.competitions.ES_SF[source]

Bases: object

Class for Spanish Supercopa Femenina

abbreviation = 'ES_SF'
description = 'Spanish Supercopa Femenina'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 370
level = 'SEN'
seasons = {'Spanish Supercopa Femenina Season 2019/2020': 336, 'Spanish Supercopa Femenina Season 2020/2021': 399, 'Spanish Supercopa Femenina Season 2021/2022': 475}
source = ''
class premier_league_api.competitions.EU_CL[source]

Bases: object

Class for UEFA Champions League

abbreviation = 'EU_CL'
description = 'UEFA Champions League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2
level = 'SEN'
seasons = {'2004/05': 351, '2006/07': 270, '2008/09': 342, '2009/10': 338, '2010/11': 178, '2011/12': 179, '2012/13': 169, '2013/14': 23, '2014/15': 29, '2015/16': 41, '2016/17': 66, '2017/18': 87, '2018/19': 214, '2019/20': 288, '2020/21': 384, '2021/22': 424, 'UEFA Champions League Season 2003/2004': 435, 'UEFA Champions League Season 2022/2023': 499}
source = ''
class premier_league_api.competitions.EU_EL[source]

Bases: object

Class for UEFA Europa Conference League

abbreviation = 'EU_EL'
description = 'UEFA Europa Conference League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2247
level = 'SEN'
seasons = {'UEFA Europa Conference League Season 2021/2022': 477, 'UEFA Europa Conference League Season 2022/2023': 528}
source = ''
class premier_league_api.competitions.EU_SC[source]

Bases: object

Class for UEFA Super Cup

abbreviation = 'EU_SC'
description = 'UEFA Super Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 24
level = 'SEN'
seasons = {'UEFA Super Cup Season 2010/2011': 132, 'UEFA Super Cup Season 2011/2012': 133, 'UEFA Super Cup Season 2012/2013': 134, 'UEFA Super Cup Season 2013/2014': 135, 'UEFA Super Cup Season 2014/2015': 136, 'UEFA Super Cup Season 2015/2016': 137, 'UEFA Super Cup Season 2016/2017': 138, 'UEFA Super Cup Season 2017/2018': 192, 'UEFA Super Cup Season 2018/2019': 208, 'UEFA Super Cup Season 2019/2020': 273, 'UEFA Super Cup Season 2020/2021': 374, 'UEFA Super Cup Season 2021/2022': 413, 'UEFA Super Cup Season 2022/2023': 484}
source = ''
class premier_league_api.competitions.EU_UC[source]

Bases: object

Class for UEFA Europa League

abbreviation = 'EU_UC'
description = 'UEFA Europa League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 3
level = 'SEN'
seasons = {'2006/07': 75, '2008/09': 334, '2009/10': 114, '2010/11': 341, '2011/12': 339, '2012/13': 72, '2013/14': 24, '2014/15': 31, '2015/16': 37, '2016/17': 70, '2017/18': 88, '2018/19': 209, '2019/20': 316, '2020/21': 385, '2021/22': 457, 'UEFA Europa League Season 1972/1973': 240, 'UEFA Europa League Season 1975/1976': 238, 'UEFA Europa League Season 1976/1977': 237, 'UEFA Europa League Season 1980/1981': 236, 'UEFA Europa League Season 1982/1983': 235, 'UEFA Europa League Season 1984/1985': 255, 'UEFA Europa League Season 1985/1986': 234, 'UEFA Europa League Season 1995/1996': 233, 'UEFA Europa League Season 2022/2023': 520}
source = ''
class premier_league_api.competitions.EU_YL[source]

Bases: object

Class for UEFA Youth League

abbreviation = 'EU_YL'
description = 'UEFA Youth League'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 34
level = 'U18'
seasons = {'UEFA Youth League Season 2013/2014': 186, 'UEFA Youth League Season 2014/2015': 187, 'UEFA Youth League Season 2015/2016': 188, 'UEFA Youth League Season 2016/2017': 189, 'UEFA Youth League Season 2017/2018': 345, 'UEFA Youth League Season 2018/2019': 318, 'UEFA Youth League Season 2019/2020': 324, 'UEFA Youth League Season 2020/2021': 402, 'UEFA Youth League Season 2021/2022': 458, 'UEFA Youth League Season 2022/2023': 530}
source = ''
class premier_league_api.competitions.IG_AT[source]

Bases: object

Class for Premier League Asia Trophy

abbreviation = 'IG_AT'
description = 'Premier League Asia Trophy'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 15
level = 'SEN'
seasons = {'2017/18': 81, 'Premier League Asia Trophy Season 2019/2020': 271}
source = ''
class premier_league_api.competitions.IG_CF[source]

Bases: object

Class for Friendly

abbreviation = 'IG_CF'
description = 'Friendly'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 14
level = 'SEN'
seasons = {'2016/2017': 84, '2017/18': 80, '2018/19': 113, '2019/20': 231, '2020/21': 333, '2021/22': 414, 'Friendly Season 2010/2011': 158, 'Friendly Season 2011/2012': 159, 'Friendly Season 2012/2013': 160, 'Friendly Season 2013/2014': 161, 'Friendly Season 2014/2015': 184, 'Friendly Season 2015/2016': 202, 'Friendly Season 2022/2023': 476}
source = ''
class premier_league_api.competitions.IG_CL[source]

Bases: object

Class for FIFA Club World Cup

abbreviation = 'IG_CL'
description = 'FIFA Club World Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 29
level = 'SEN'
seasons = {'FIFA Club World Cup Season 2010/2011': 151, 'FIFA Club World Cup Season 2011/2012': 152, 'FIFA Club World Cup Season 2012/2013': 153, 'FIFA Club World Cup Season 2013/2014': 154, 'FIFA Club World Cup Season 2014/2015': 155, 'FIFA Club World Cup Season 2015/2016': 156, 'FIFA Club World Cup Season 2016/2017': 157, 'FIFA Club World Cup Season 2017/2018': 195, 'FIFA Club World Cup Season 2018/2019': 225, 'FIFA Club World Cup Season 2019/2020': 326, 'FIFA Club World Cup Season 2020/2021': 400, 'FIFA Club World Cup Season 2021/2022': 470}
source = ''
class premier_league_api.competitions.IG_CT[source]

Bases: object

Class for International Champions Cup

abbreviation = 'IG_CT'
description = 'International Champions Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 30
level = 'SEN'
seasons = {'International Champions Cup Season 2013/2014': 170, 'International Champions Cup Season 2014/2015': 171, 'International Champions Cup Season 2015/2016': 172, 'International Champions Cup Season 2016/2017': 173, 'International Champions Cup Season 2017/2018': 199, 'International Champions Cup Season 2018/2019': 204, 'International Champions Cup Season 2019/2020': 244}
source = ''
class premier_league_api.competitions.IG_FW[source]

Bases: object

Class for Club Friendlies Women

abbreviation = 'IG_FW'
description = 'Club Friendlies Women'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2077
level = 'SEN'
seasons = {'Club Friendlies Women Season 2020/2021': 454, 'Club Friendlies Women Season 2021/2022': 452, 'Club Friendlies Women Season 2022/2023': 491}
source = ''
class premier_league_api.competitions.IG_FY[source]

Bases: object

Class for CONMEBOL/UEFA Youth Finalissima

abbreviation = 'IG_FY'
description = 'CONMEBOL/UEFA Youth Finalissima'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2479
level = 'U18'
seasons = {'CONMEBOL/UEFA Youth Finalissima Season 2022/2023': 526}
source = ''
class premier_league_api.competitions.IG_HY[source]

Bases: object

Class for Hybrid Friendlies

abbreviation = 'IG_HY'
description = 'Hybrid Friendlies'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2345
level = 'SEN'
seasons = {'Hybrid Friendlies Season 2021/2022': 482, 'Hybrid Friendlies Season 2022/2023': 507}
source = ''
class premier_league_api.competitions.IG_OF[source]

Bases: object

Class for Other Club Friendlies

abbreviation = 'IG_OF'
description = 'Other Club Friendlies'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 210
level = 'SEN'
seasons = {'2019/20': 292, '2020/21': 361, '2021/22': 423, 'Other Club Friendlies Season 2022/2023': 487}
source = ''
class premier_league_api.competitions.IG_WO[source]

Bases: object

Class for Internationals Women

abbreviation = 'IG_WO'
description = 'Internationals Women'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 1871
level = 'SEN'
seasons = {'Internationals Women Season 2016/2017': 535, 'Internationals Women Season 2018/2019': 509, 'Internationals Women Season 2019/2020': 405, 'Internationals Women Season 2020/2021': 404, 'Internationals Women Season 2021/2022': 411, 'Internationals Women Season 2022/2023': 473}
source = ''
class premier_league_api.competitions.LD_P1[source]

Bases: object

Class for Scottish Championship Play-offs

abbreviation = 'LD_P1'
description = 'Scottish Championship Play-offs'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 74
level = 'SEN'
seasons = {'Scottish Championship Play-offs Season 2018/2019': 266, 'Scottish Championship Play-offs Season 2020/2021': 408, 'Scottish Championship Play-offs Season 2021/2022': 478}
source = ''
class premier_league_api.competitions.LD_P2[source]

Bases: object

Class for Scottish League One Play-offs

abbreviation = 'LD_P2'
description = 'Scottish League One Play-offs'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 75
level = 'SEN'
seasons = {'Scottish League One Play-offs Season 2018/2019': 267, 'Scottish League One Play-offs Season 2020/2021': 409, 'Scottish League One Play-offs Season 2021/2022': 479}
source = ''
class premier_league_api.competitions.LD_P3[source]

Bases: object

Class for Scottish League Two Play-offs

abbreviation = 'LD_P3'
description = 'Scottish League Two Play-offs'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 76
level = 'SEN'
seasons = {'Scottish League Two Play-offs Season 2018/2019': 268, 'Scottish League Two Play-offs Season 2020/2021': 410, 'Scottish League Two Play-offs Season 2021/2022': 480}
source = ''
class premier_league_api.competitions.LD_PP[source]

Bases: object

Class for Scottish Premiership Play-offs

abbreviation = 'LD_PP'
description = 'Scottish Premiership Play-offs'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 77
level = 'SEN'
seasons = {'Scottish Premiership Play-offs Season 2018/2019': 269, 'Scottish Premiership Play-offs Season 2020/2021': 407, 'Scottish Premiership Play-offs Season 2021/2022': 481}
source = ''
class premier_league_api.competitions.LD_S1[source]

Bases: object

Class for Scottish Championship

abbreviation = 'LD_S1'
description = 'Scottish Championship'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 44
level = 'SEN'
seasons = {'Scottish Championship Season 2018/2019': 259, 'Scottish Championship Season 2019/2020': 281, 'Scottish Championship Season 2020/2021': 359, 'Scottish Championship Season 2021/2022': 419, 'Scottish Championship Season 2022/2023': 497}
source = ''
class premier_league_api.competitions.LD_S2[source]

Bases: object

Class for Scottish League One

abbreviation = 'LD_S2'
description = 'Scottish League One'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 48
level = 'SEN'
seasons = {'Scottish League One Season 2014/2015': 471, 'Scottish League One Season 2018/2019': 262, 'Scottish League One Season 2019/2020': 282, 'Scottish League One Season 2020/2021': 358, 'Scottish League One Season 2021/2022': 422, 'Scottish League One Season 2022/2023': 495}
source = ''
class premier_league_api.competitions.LD_S3[source]

Bases: object

Class for Scottish League Two

abbreviation = 'LD_S3'
description = 'Scottish League Two'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 42
level = 'SEN'
seasons = {'Scottish League Two Season 2015/2016': 387, 'Scottish League Two Season 2016/2017': 386, 'Scottish League Two Season 2018/2019': 256, 'Scottish League Two Season 2019/2020': 283, 'Scottish League Two Season 2020/2021': 360, 'Scottish League Two Season 2021/2022': 420, 'Scottish League Two Season 2022/2023': 496}
source = ''
class premier_league_api.competitions.LD_SP[source]

Bases: object

Class for Scottish Premiership

abbreviation = 'LD_SP'
description = 'Scottish Premiership'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 46
level = 'SEN'
seasons = {'Scottish Premiership Season 2005/2006': 403, 'Scottish Premiership Season 2018/2019': 261, 'Scottish Premiership Season 2019/2020': 280, 'Scottish Premiership Season 2020/2021': 352, 'Scottish Premiership Season 2021/2022': 421, 'Scottish Premiership Season 2022/2023': 493}
source = ''
class premier_league_api.competitions.PLC_U16[source]

Bases: object

Class for English U16 Premier League Cup

abbreviation = 'PLC_U16'
description = 'English U16 Premier League Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 19
level = 'SEN'
seasons = {'English U16 Premier League Cup Season 2017/2018': 101, 'English U16 Premier League Cup Season 2018/2019': 229, 'English U16 Premier League Cup Season 2019/2020': 329, 'English U16 Premier League Cup Season 2021/2022': 464, 'English U16 Premier League Cup Season 2022/2023': 532}
source = ''
class premier_league_api.competitions.PLC_U18[source]

Bases: object

Class for U18 Premier League Cup

abbreviation = 'PLC_U18'
description = 'U18 Premier League Cup'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 18
level = 'U18'
seasons = {'2017/18': 100, '2018/19': 227, '2019/20': 317, '2021/22': 459, 'English U18 Premier League Cup Season 2022/2023': 527}
source = ''
class premier_league_api.competitions.PL_D1[source]

Bases: object

Class for Premier League 2 - Division 1

abbreviation = 'PL_D1'
description = 'Premier League 2 - Division 1'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 16
level = 'U21'
seasons = {'2016/17': 98, '2017/18': 90, '2018/19': 217, '2019/20': 295, '2020/21': 375, '2021/22': 438, '2022/23': 515}
source = ''
class premier_league_api.competitions.PL_D2[source]

Bases: object

Class for Premier League 2 - Division 2

abbreviation = 'PL_D2'
description = 'Premier League 2 - Division 2'
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 17
level = 'U21'
seasons = {'2016/17': 99, '2017/18': 96, '2018/19': 218, '2019/20': 294, '2020/21': 376, '2021/22': 447, '2022/23': 516}
source = ''
class premier_league_api.competitions.WO_CC[source]

Bases: object

Class for Women’s International Champions Cup

abbreviation = 'WO_CC'
description = "Women's International Champions Cup"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 2078
level = 'SEN'
seasons = {"Women's International Champions Cup Season 2021/2022": 453, "Women's International Champions Cup Season 2022/2023": 488}
source = ''
class premier_league_api.competitions.WO_CL[source]

Bases: object

Class for UEFA Women’s Champions League

abbreviation = 'WO_CL'
description = "UEFA Women's Champions League"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 348
level = 'SEN'
seasons = {"UEFA Women's Champions League Season 2019/2020": 319, "UEFA Women's Champions League Season 2020/2021": 397, "UEFA Women's Champions League Season 2021/2022": 461}
source = ''
class premier_league_api.competitions.WO_FA[source]

Bases: object

Class for Women’s FA Cup

abbreviation = 'WO_FA'
description = "Women's FA Cup"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 345
level = 'SEN'
seasons = {'2016/17': 310, '2017/18': 305, '2018/19': 311, '2019/20': 335, '2020/21': 391, "Women's FA Cup Season 2012/2013": 304, "Women's FA Cup Season 2013/2014": 301, "Women's FA Cup Season 2014/2015": 302, "Women's FA Cup Season 2015/2016": 308, "Women's FA Cup Season 2021/2022": 468}
source = ''
class premier_league_api.competitions.WO_LC[source]

Bases: object

Class for FA Women’s Continental League Cup

abbreviation = 'WO_LC'
description = "FA Women's Continental League Cup"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 346
level = 'SEN'
seasons = {'2016/17': 307, '2017/18': 309, '2018/19': 313, '2019/20': 325, '2020/21': 383, '2021/22': 463, "FA Women's League Cup Season 2022/2023": 536}
source = ''
class premier_league_api.competitions.WO_SL[source]

Bases: object

Class for English Women’s Super League

abbreviation = 'WO_SL'
description = "English Women's Super League"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 38
level = 'SEN'
seasons = {'2013/2014': 245, '2014/2015': 252, '2015/2016': 254, '2016/2017': 248, '2017/2018': 247, '2018/2019': 250, '2019/20': 290, '2020/21': 356, '2021/22': 433, "English Women's Super League Season 2011/2012": 524, "English Women's Super League Season 2012/2013": 525, "English Women's Super League Season 2022/2023": 510}
source = ''
class premier_league_api.competitions.WO_SL2[source]

Bases: object

Class for English Women’s Championship

abbreviation = 'WO_SL2'
description = "English Women's Championship"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 45
level = 'SEN'
seasons = {'2018/19': 260, '2019/20': 291, '2020/21': 364, '2021/22': 445, "English Women's Championship Season 2022/2023": 511}
source = ''
class premier_league_api.competitions.WO_SS[source]

Bases: object

Class for Women’s Super League Spring Series

abbreviation = 'WO_SS'
description = "Women's Super League Spring Series"
static get_season_by_label(label: str) Optional[int][source]

Get a season by the label :param label: String of label :type label: str :return: Season ID :rtype: int

id = 41
level = 'SEN'
seasons = {"Women's Super League Spring Series Season 2016/2017": 251}
source = ''

premier_league_api.errors module

Errors for premier_league_api

exception premier_league_api.errors.EmptyResponse[source]

Bases: Exception

Error raised if a response body is empty

premier_league_api.fixture module

Gameweek Fixture Results

class premier_league_api.fixture.FixtureEvent(data: dict)[source]

Bases: object

Represents an event that happened in the fixture

description
Returns

Description of the event

Return type

str

players
Returns

Players ids involved

Return type

List[int]

seconds
Returns

Second of the game when the event happened

Return type

int

timeLabel
Returns

Clock time of the event

Return type

str

class premier_league_api.fixture.FixtureResult(data: dict)[source]

Bases: object

Results of fixture that has completed

abbr_score
Returns

Score with team

Return type

str

attendance
Returns

Reported attendance

Return type

int

awayTeam
Returns

Away team for the fixture

Return type

FixtureTeam

city
Returns

City where the game was played

Return type

str

events
Returns

Events of the match. A gameweek fixture will return an empty list

Return type

List[FixtureEvent]

gameweek
Returns

Gameweek of fixture

Return type

int

homeTeam
Returns

Home team for the fixture

Return type

FixtureTeam

neutral
Returns

Fixture played a neutral ground

Return type

bool

outcome
Returns

Outcome of match

Return type

str

score
Returns

Score with full team names

Return type

str

seconds
Returns

Total seconds of the match

Return type

int

short_score
Returns

Score with short team names

Return type

str

stadium
Returns

Stadium where the game was played

Return type

str

time
Returns

Final clock time

Return type

str

winner
Returns

Winning team. None if draw

Return type

FixtureTeam

premier_league_api.gameweek module

Responsible for handing full gameweeks

class premier_league_api.gameweek.GameWeekFixture(data: dict)[source]

Bases: FixtureResult

Gameweek fixture. Does not have fixture events

goals

Goals scored in the fixture :return: List of goals :rtype: List[GameWeekGoal]

class premier_league_api.gameweek.GameWeekGoal(data: dict)[source]

Bases: object

Goal from a gameweek fixture

assist
Returns

Id of player who assisted the score if any

Return type

int

description
Returns

Usually same as type

Return type

str

phase
Returns

Phase of the game when the goal was scored

Return type

str

scorer
Returns

Id of player who scored the goal

Return type

int

seconds
Returns

Second when goal was scored

Return type

int

time
Returns

Time when goal was scored

Return type

str

type
Returns

Type of goal. Either G for goal or P for penalty

Return type

str

class premier_league_api.gameweek.GameWeeks(data: dict)[source]

Bases: object

Gameweeks represent a week of matches

end
Returns

End of gameweek

Return type

MatchTime

gameweek_num
Returns

Number of the gameweek

Return type

int

id
Returns

ID of gameweek

Return type

int

matches
Returns

Amount of matches in gameweek

Return type

int

start
Returns

Start of gameweek

Return type

MatchTime

status
Returns

Status of the gameweek

Return type

str

premier_league_api.meta_competitions module

Generate competitions file

premier_league_api.meta_competitions.create_competitions_file()[source]

Create a new competitions file

premier_league_api.meta_competitions.download_competitions() List[COMPETITION_TEXT][source]

Downloads and returns a list of filled out COMPETITION Text

Returns

List of filled out text

Return type

List[COMPETITION_TEXT]

premier_league_api.player module

Responsible for player stats

class premier_league_api.player.BasePlayer(data: dict)[source]

Bases: object

Base player

age
Returns

Age of player. Includes years and days

Return type

str

birthCountry
Returns

Country born in

Return type

Country

birthday
Returns

Birthday of player

Return type

str

birthplace
Returns

City of birth

Return type

str

birthtime
Returns

Epoch time representation of birthday

Return type

int

firstName
Returns

Player’s first name

Return type

str

fullName
Returns

Player’s full name

Return type

str

lastName
Returns

Player’s last name

Return type

str

loan
Returns

On loan

Return type

bool

nationalTeam
Returns

Country played for

Return type

Country

position
Returns

Position played. Either G, D, M, F

Return type

str

positionInfo
Returns

More detailed position

Return type

str

shirtNumber
Returns

Number worn by player

Return type

int

class premier_league_api.player.Player(data: dict, generate_stats: bool = False)[source]

Bases: BasePlayer

Player object for full player

generate_stats()[source]

Generate the stats for the player. Not run by default because it adds around 150 attributes

class premier_league_api.player.PlayerStat(data: dict)[source]

Bases: object

Base stats for a player

additionalInfo
Returns

Additional Info on stat. Usually empty

Return type

dict

description
Returns

Description of stat

Return type

str

name
Returns

Name of stat

Return type

str

value
Returns

Value of stat

Return type

int

class premier_league_api.player.SearchPlayer(data: dict)[source]

Bases: BasePlayer

Search result for a player

appearances
Returns

Amount of goals scored

Return type

int

assists
Returns

Amount of assists

Return type

int

cleanSheets
Returns

Amount of clean sheets

Return type

int

goals
Returns

Amount of goals

Return type

int

goalsConceded
Returns

Amount of goals conceded

Return type

int

height
Returns

Height in CM of the player

Return type

int

keyPasses
Returns

Amount of key passes

Return type

int

saves
Returns

Amount of saves

Return type

int

shots
Returns

Amount of shots

Return type

int

tackles
Returns

Amount of tackles

Return type

int

weight
Returns

Weight of player

Return type

int

premier_league_api.shared module

Shared classes

class premier_league_api.shared.Country(data: dict)[source]

Bases: object

Class that presents a country

country
Returns

Name of country

Return type

str

demonym
Returns

Demonym of country

Return type

str

iso_code
Returns

ISO code

Return type

str

class premier_league_api.shared.MatchTime(data: dict)[source]

Bases: object

Time of a match. Used for start and end

completeness
Returns

Completeness of the match. Uncertain as to the full range of values and what they mean

Return type

int

epoch
Returns

Epoch time in milliseconds

Return type

int

gmtOffset
Returns

GMT offset of time

Return type

int

label
Returns

Label of time

Return type

str

class premier_league_api.shared.Team(data: dict)[source]

Bases: object

Class that represents a team

abbreviation
Returns

Abbreviation of the team

Return type

str

id
Returns

ID of the team

Return type

int

score
Returns

Number of goals scored

Return type

int

short_name
Returns

Short name of the team

Return type

str

team_type

If the team is senior, U21, or U18

Returns

Type of team

Return type

str

Module contents

API for calling premier league stats and possibly for more leagues

class premier_league_api.APIClient[source]

Bases: object

Main api client that handles making all the requests and classes

get_fixture(fixture_id: int, language_code: str = 'EN') FixtureResult[source]

Get a fixture by ID

Parameters
  • fixture_id (int) – Id of the fixture to get

  • language_code (str) – Language code to get. Note: Changing to anything but EN seems to leave the Fixture events blank

Returns

Fixture

Return type

FixtureResult

get_fixtures(season_id: int, gameweek: Optional[int] = None) List[GameWeekFixture][source]

Get a list of all the fixtures in a season/gameweek

Parameters
  • season_id (int) – Season ID to get fixtures for

  • gameweek – Gameweek to get fixtures for. If left out will return the entire season

Returns

List of GameWeekFixture

Return type

List[GameWeekFixture]

get_gameweek(season_id: int, gameweek: int, matches_per_week: int = 10) List[GameWeekFixture][source]

Get fixtures for a specific gameweek of the season

Parameters
  • season_id (str) – Season ID of the season that the gameweek took place in

  • gameweek (int) – Number of the game week to get

  • matches_per_week (int) – How many matches there are per game week. It should be equal to half the amount of teams. Elimination tournaments will be tricky

Returns

List of matches

Return type

List[GameWeekFixture]

get_gameweeks(season_id: int) List[GameWeeks][source]

Get gameweeks for a season

Parameters

season_id (int) – Id of the season

Returns

Gameweeks in the season

Return type

List[GameWeeks]

get_player(player_id: int, comp_id: Optional[int] = None, season_id: Optional[int] = None, generate_stats: bool = False) Player[source]

Get a player by their ID

Parameters
  • generate_stats (bool) – Generate the stats for the player. Defaults to false

  • player_id (int) – ID of the player

  • comp_id – Competition ID of the competition to get stats for

  • season_id – Season ID to get stats for. You can use this without competition ID

Returns

The player

Return type

Player

get_teams_in_season(season_id: int) List[Team][source]

Get all the teams that are taking part in a season

Parameters

season_id (int) – Season ID to get

Returns

List of teams for the season

Return type

List[Team]

search_player(player_name: str, league_name: str = 'PremierLeague') List[SearchPlayer][source]

Searches for a player by a name

Parameters
  • player_name (str) – Full or partial name of the player

  • league_name (str) –

Returns

Possible matches. Max length of 30

Todo: Implement pagination for results

exception premier_league_api.EmptyResponse[source]

Bases: Exception

Error raised if a response body is empty

premier_league_api.create_competitions_file()[source]

Create a new competitions file