footballdata package

Submodules

footballdata.connector module

footballdata.connector

This module contains utilities to connect to API.

copyright:
  1. 2018 Tony Joseph
license:

BSD 3-Clause

class footballdata.connector.Connector(api_key='', api_version='v1')[source]

Bases: object

Class to initialise connection to football-data.org

api_key

Returns API key given at the time of initiating the object

Returns:str - API key
api_version

Returns API version given at the time of initiating the object

Returns:str - API version
get_competitions(season='', force_update=False)[source]

Fetches all competitions

Parameters:
  • force_update – Boolean, overrides cached results if True
  • season – 4 digit integer representing a season, optional
Returns:

DataSet of Competition objects

get_fixtures(force_update=False)[source]

Fetches all fixtures

Parameters:force_update – Boolean, overrides cached results if True
Returns:DataSet of Fixture objects
classmethod supported_api_versions()[source]

Returns the supported api versions as list

footballdata.datasets module

footballdata.datasets

This module implements the data structures used to represent the data returned from the API.

copyright:
  1. 2018 Tony Joseph
license:

BSD 3-Clause

class footballdata.datasets.Competition(**kwargs)[source]

Bases: footballdata.datasets.FootballDataObject

Class to represent a competition

get_fixtures(force_update=False)[source]

Fetches all fixtures in a competition

Parameters:force_update – Boolean, overrides cached results if True
Returns:DataSet of Fixture objects
get_league_table(force_update=False)[source]

Fetches standing of all teams in competition

Parameters:force_update – Boolean, overrides cached results if True
Returns:DataSet of Standing objects
get_teams(force_update=False)[source]

Fetches all teams in a competition

Parameters:force_update – Boolean, overrides cached results if True
Returns:DataSet of Team objects
class footballdata.datasets.DataSet(klass, endpoint='', api_key='', options=None, data_list=None)[source]

Bases: object

Class to represent a sequence of football data objects

class footballdata.datasets.Fixture(**kwargs)[source]

Bases: footballdata.datasets.FootballDataObject

Class to represent a fixture

class footballdata.datasets.FootballDataObject(**kwargs)[source]

Bases: object

Parent class for all football data components

class footballdata.datasets.Player(**kwargs)[source]

Bases: footballdata.datasets.FootballDataObject

Class to represent a player

class footballdata.datasets.Standing(**kwargs)[source]

Bases: footballdata.datasets.FootballDataObject

Class to represent a team’s standing in a competition

class footballdata.datasets.Team(**kwargs)[source]

Bases: footballdata.datasets.FootballDataObject

Class to represent a team

get_fixtures(force_update=False)[source]

Fetches all fixtures for a team

Parameters:force_update – Boolean, overrides cached results if True
Returns:DataSet of Fixture objects
get_players(force_update=False)[source]

Fetches all players in a team

Parameters:force_update – Boolean, overrides cached results if True
Returns:DataSet of Player objects

footballdata.utils module

footballdata.utils

Implements various helpers.

copyright:
  1. 2018 Tony Joseph
license:

BSD 3-Clause

footballdata.utils.camel_to_snake(name)[source]

Takes a string in camel case and converts it to snake case

Parameters:name – String to convert to snake case
Returns:String in snake case
footballdata.utils.clean_object(data)[source]

Takes data from api and build data dictionary with proper keys

Parameters:data – Dict data from api
Returns:Dict with proper keys and meta data removed
footballdata.utils.fetch_data_from_api(endpoint, api_key='', options=None)[source]

Fetches data from the endpoint and returns it

Parameters:
  • endpoint – api endpoint to connect
  • api_key – optional api key
  • options – data to sent with api call
Returns:

Module contents

footballdata

Football Data Connector is a Python package to connect to football-data.org API.

copyright:
  1. 2018 Tony Joseph
license:

BSD 3-Clause