socceraction.data.wyscout.WyscoutLoader

class socceraction.data.wyscout.WyscoutLoader(root='https://apirest.wyscout.com/v2/', getter='remote', feeds=None, creds=None)

Load event data either from a remote location or from a local folder.

Parameters:
  • root (str) – Root-path of the data.

  • getter (str or callable, default: "remote") – “remote”, “local” or a function that returns loads JSON data from a path.

  • feeds (dict(str, str)) –

    Glob pattern for each feed that should be parsed. The default feeds for a “remote” getter are:

    {
        'competitions': 'competitions',
        'seasons': 'competitions/{season_id}/seasons',
        'games': 'seasons/{season_id}/matches',
        'events': 'matches/{game_id}/events?fetch=teams,players,match,substitutions'
    }
    

    The default feeds for a “local” getter are:

    {
        'competitions': 'competitions.json',
        'seasons': 'seasons_{competition_id}.json',
        'games': 'matches_{season_id}.json',
        'events': 'matches/events_{game_id}.json',
    }
    

  • creds (dict, optional) – Login credentials in the format {“user”: “”, “passwd”: “”}. Only used when getter is “remote”.

Methods

__init__

competitions

Return a dataframe with all available competitions and seasons.

events

Return a dataframe with the event stream of a game.

games

Return a dataframe with all available games in a season.

players

Return a dataframe with all players that participated in a game.

teams

Return a dataframe with both teams that participated in a game.