Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/probberechts/soccerdata
/ functions
Functions
201 in github.com/probberechts/soccerdata
⨍
Functions
201
◇
Types & classes
14
↓ 85 callers
Method
get
Load data from `url`. By default, the source of `url` is downloaded and saved to `filepath`. If `filepath` exists, the `url` is not v
soccerdata/_common.py:253
↓ 49 callers
Method
parse
Convert a string or int to a standard season format.
soccerdata/_common.py:99
↓ 40 callers
Function
_as_int
(value: Any)
soccerdata/understat.py:750
↓ 20 callers
Method
_is_complete
Check if a season is complete.
soccerdata/fbref.py:133
↓ 19 callers
Function
_as_float
(value: Any)
soccerdata/understat.py:743
↓ 17 callers
Function
_as_str
(value: Any)
soccerdata/understat.py:757
↓ 11 callers
Function
_parse_table
Parse HTML table into a dataframe. Parameters ---------- html_table : lxml.html.HtmlElement HTML table to clean up. Returns
soccerdata/fbref.py:1037
↓ 9 callers
Method
read_seasons
Retrieve the selected seasons for the selected leagues. Parameters ---------- split_up_big5: bool If True, it wil
soccerdata/fbref.py:190
↓ 8 callers
Function
_concat
Merge matching tables scraped from different pages. The level 0 headers are not consistent across seasons and leagues, this function tries to
soccerdata/fbref.py:1067
↓ 8 callers
Method
read_team_history
Retrieve full ELO history for one club. For the exact spelling of a club's name, check the result of :func:`~soccerdata.ClubElo.read_
soccerdata/clubelo.py:113
↓ 6 callers
Method
_all_leagues
Return a dict mapping all canonical league IDs to source league IDs.
soccerdata/_common.py:374
↓ 6 callers
Method
read_leagues
Retrieve selected leagues from the datasource. Parameters ---------- split_up_big5: bool If True, it will load th
soccerdata/fbref.py:145
↓ 6 callers
Method
read_schedule
Retrieve the game schedule for the selected leagues and seasons. Parameters ---------- force_cache : bool By def
soccerdata/espn.py:74
↓ 5 callers
Method
read_by_date
Retrieve ELO scores for all teams at specified date. Elo scores are available as early as 1939. Values before 1960 should be consider
soccerdata/clubelo.py:63
↓ 5 callers
Method
read_player_match_stats
Retrieve the match stats for the selected leagues and seasons. The following stat types are available: * 'summary' *
soccerdata/fbref.py:703
↓ 4 callers
Function
add_alt_team_names
Add a set of alternative team names for a standardized team name. If a standardized team name is given, add the set of alternative names used
soccerdata/_common.py:679
↓ 4 callers
Method
read_events
Retrieve match events for the selected seasons or selected matches. The data returned includes the timing of goals, cards and substitutions.
soccerdata/fbref.py:900
↓ 4 callers
Method
read_player_season_stats
Retrieve players from the datasource for the selected leagues and seasons. The following stat types are available: * 'standard'
soccerdata/fbref.py:512
↓ 4 callers
Method
read_team_match_stats
Retrieve the match logs for all teams in the selected leagues and seasons. The following stat types are available: * 'schedule'
soccerdata/fbref.py:339
↓ 4 callers
Method
read_team_season_stats
Retrieve aggregated season stats for all teams in the selected leagues and seasons. The following stat types are available: * 'st
soccerdata/fbref.py:239
↓ 4 callers
Method
read_versions
Retrieve available FIFA releases and rating updates. Parameters ---------- max_age : int for age in days, or timedelta object
soccerdata/sofifa.py:125
↓ 3 callers
Method
_check_dataframe
Check if the dataframe has the expected structure.
tests/test_ClubElo.py:16
↓ 3 callers
Method
_ensure_cookies
Ensure the session has cookies from the homepage.
soccerdata/understat.py:90
↓ 3 callers
Method
_parse_teams
Parse the teams from a match summary page. Parameters ---------- tree : etree.ElementTree The match summary page.
soccerdata/fbref.py:685
↓ 3 callers
Function
_parse_url
Parse a URL from WhoScored. Parameters ---------- url : str URL to parse. Raises ------ ValueError If the UR
soccerdata/whoscored.py:76
↓ 3 callers
Method
_read_league_season
( self, url: str, league_id: int, season_id: int, no_cache: bool = False )
soccerdata/understat.py:657
↓ 3 callers
Method
_request_api
Make an API request with proper headers and caching.
soccerdata/understat.py:706
↓ 3 callers
Function
add_standardized_team_name
Add the standardized team name for a non-standardized team name. If a non-standardized team name is given, add the standardized name. If a st
soccerdata/_common.py:707
↓ 3 callers
Method
read_lineup
Retrieve lineups for the selected leagues and seasons. Parameters ---------- match_id : int or list of int, optional
soccerdata/espn.py:210
↓ 3 callers
Method
read_players
Retrieve all players for the selected leagues. Parameters ---------- team: str or list of str, optional Team(s) t
soccerdata/sofifa.py:221
↓ 3 callers
Method
read_schedule
Retrieve the game schedule for the selected leagues and seasons. Parameters ---------- force_cache : bool By def
soccerdata/fbref.py:611
↓ 3 callers
Method
read_seasons
Retrieve the selected seasons for the selected leagues. Returns ------- pd.DataFrame
soccerdata/sofascore.py:102
↓ 3 callers
Method
read_seasons
Retrieve the selected seasons from the datasource. Returns ------- pd.DataFrame
soccerdata/understat.py:134
↓ 3 callers
Method
read_shot_events
Retrieve the shot events for the selected matches or the selected leagues and seasons. Parameters ---------- match_id : int o
soccerdata/understat.py:538
↓ 2 callers
Method
__init__
Create a new data reader.
soccerdata/_common.py:221
↓ 2 callers
Method
_check_dataframe
Check if the dataframe has the expected structure.
tests/test_ClubElo.py:56
↓ 2 callers
Method
_extract_team_name
Extract team name from tmpl HTML.
soccerdata/understat.py:728
↓ 2 callers
Method
_init_session
(self, headers: Optional[dict[str, str]] = None)
soccerdata/_common.py:493
↓ 2 callers
Method
_init_webdriver
Start the Selenium driver.
soccerdata/_common.py:576
↓ 2 callers
Function
_parse_csv
(data: IO[bytes])
soccerdata/clubelo.py:18
↓ 2 callers
Method
_read_leagues
(self, no_cache: bool = False)
soccerdata/understat.py:649
↓ 2 callers
Method
_read_match
(self, url: str, match_id: int)
soccerdata/understat.py:676
↓ 2 callers
Method
_select_matches
( self, df_schedule: pd.DataFrame, match_id: Optional[Union[int, list[int]]] = None,
soccerdata/understat.py:634
↓ 2 callers
Method
available_leagues
Return a list of league IDs available for this source.
soccerdata/_common.py:369
↓ 2 callers
Method
from_league
Return the default season code for a league. Parameters ---------- league : str The league to consider.
soccerdata/_common.py:40
↓ 2 callers
Method
from_leagues
Determine the season code to use for a set of leagues. If the given leagues have different default season codes, the multi-year forma
soccerdata/_common.py:74
↓ 2 callers
Method
read_leagues
Retrieve selected leagues from the datasource. Returns ------- pd.DataFrame
soccerdata/sofifa.py:94
↓ 2 callers
Method
read_matchsheet
Retrieve match sheets for the selected leagues and seasons. Parameters ---------- match_id : int or list of int, optional
soccerdata/espn.py:139
↓ 2 callers
Method
read_schedule
Retrieve the game schedule for the selected leagues and seasons. Parameters ---------- force_cache : bool By def
soccerdata/whoscored.py:326
↓ 2 callers
Method
read_schedule
Retrieve the matches for the selected leagues and seasons. Parameters ---------- include_matches_without_data : bool
soccerdata/understat.py:180
↓ 2 callers
Function
to_snake
(name: str)
soccerdata/_common.py:737
↓ 1 callers
Method
_all_leagues
Return a dict mapping all canonical league IDs to source league IDs.
soccerdata/fbref.py:121
↓ 1 callers
Function
_as_bool
(value: Any)
soccerdata/understat.py:736
↓ 1 callers
Method
_download_and_save
Download data at `url` to `filepath`. Parameters ---------- url : str URL to download. filepath : Path, o
soccerdata/_common.py:345
↓ 1 callers
Function
_fix_nation_col
Fix the "Nation" column. Adds a 'nations' column for international games based on the team's name. Parameters ---------- df_table :
soccerdata/fbref.py:1175
↓ 1 callers
Method
_is_cached
Check if `filepath` contains valid cached data. Parameters ---------- filepath : Path, optional Path where file s
soccerdata/_common.py:299
↓ 1 callers
Function
_parse_csv
(raw_data: IO[bytes], lkey: str, skey: str)
soccerdata/match_history.py:16
↓ 1 callers
Method
_validate_page
Validate the page content. This method can be overridden by subclasses to implement site-specific validation or polling logic.
soccerdata/_common.py:635
↓ 1 callers
Function
check_proxy
Check if proxy is working.
soccerdata/_common.py:798
↓ 1 callers
Function
make_game_id
Return a game id based on date, home and away team.
soccerdata/_common.py:663
↓ 1 callers
Method
read_games
Retrieve game history for the selected leagues and seasons. Column names are explained here: http://www.football-data.co.uk/notes.txt
soccerdata/match_history.py:79
↓ 1 callers
Method
read_league_table
Retrieve the league table for the selected leagues. Parameters ---------- force_cache : bool By default no cache
soccerdata/sofascore.py:130
↓ 1 callers
Method
read_leagues
Retrieve the selected leagues from the datasource. Returns ------- pd.DataFrame
soccerdata/whoscored.py:179
↓ 1 callers
Method
read_leagues
Retrieve the selected leagues from the datasource. Returns ------- pd.DataFrame
soccerdata/sofascore.py:73
↓ 1 callers
Method
read_missing_players
Retrieve a list of injured and suspended players ahead of each game. Parameters ---------- match_id : int or list of int, opt
soccerdata/whoscored.py:480
↓ 1 callers
Method
read_player_ratings
Retrieve ratings for players. Parameters ---------- team: str or list of str, optional Team(s) to retrieve. If No
soccerdata/sofifa.py:382
↓ 1 callers
Method
read_season_stages
Retrieve the season stages for the selected leagues. Parameters ---------- force_cache : bool By default no cach
soccerdata/whoscored.py:256
↓ 1 callers
Method
read_seasons
Retrieve the selected seasons for the selected leagues. Returns ------- pd.DataFrame
soccerdata/whoscored.py:213
↓ 1 callers
Method
read_team_ratings
Retrieve ratings for all teams in the selected leagues. Returns ------- pd.DataFrame
soccerdata/sofifa.py:294
↓ 1 callers
Method
read_teams
Retrieve all teams for the selected leagues. Returns ------- pd.DataFrame
soccerdata/sofifa.py:170
↓ 1 callers
Function
safe_xpath_text
(node: _Element, xpath_expr: str, warn: Optional[str] = None)
soccerdata/_common.py:808
↓ 1 callers
Function
standardize_colnames
Convert DataFrame column names to snake case.
soccerdata/_common.py:734
Method
__init__
Initialize SoFIFA reader.
soccerdata/sofifa.py:63
Method
__init__
Initialize the WhoScored reader.
soccerdata/whoscored.py:149
Method
__init__
Initialize a new ESPN reader.
soccerdata/espn.py:55
Method
__init__
Initialize the Sofascore reader.
soccerdata/sofascore.py:50
Method
__init__
Initialize FBref reader.
soccerdata/fbref.py:75
Method
__init__
Initialize a new Understat reader.
soccerdata/understat.py:70
Method
__init__
Initialize the reader.
soccerdata/_common.py:473
Method
__init__
Initialize the reader.
soccerdata/_common.py:541
Method
__init__
Initialize a new ClubElo reader.
soccerdata/clubelo.py:53
Method
__init__
( self, leagues: Optional[Union[str, list[str]]] = None, seasons: Optional[Union[str,
soccerdata/match_history.py:65
Method
_download_and_save
Download file at url to filepath. Overwrites if filepath exists.
soccerdata/_common.py:496
Method
_download_and_save
Download file at url to filepath. Overwrites if filepath exists.
soccerdata/_common.py:594
Method
_handle_banner
(self)
soccerdata/whoscored.py:812
Method
_is_complete
Check if a season is complete.
soccerdata/_common.py:421
Method
_read_game_info
Return game info available in the header.
soccerdata/whoscored.py:444
Function
_return_csv
(content="Rank,Club,Country\n1,Barcelona,ESP")
tests/test_common.py:30
Function
_return_js_var
Mimics: var name = JSON.parse('\x7b\x22key\x22\x3a\x22value\x22\x7d') The regex in the reader expects string-escaped content
tests/test_common.py:38
Method
_season_code
(self)
soccerdata/fbref.py:128
Method
_season_code
(self)
soccerdata/_common.py:418
Method
_selected_leagues
Return a dict mapping selected canonical league IDs to source league IDs.
soccerdata/_common.py:392
Method
_translate_league
Map source league ID to canonical ID.
soccerdata/_common.py:383
Method
_validate_page
Validate the page content. For JSON API endpoints, return the page text so json.load works. For HTML pages, use the base class logic
soccerdata/sofifa.py:502
Method
_validate_page
Validate the page content. Checks for the 'Incapsula incident ID' which indicates an IP block. Parameters ----------
soccerdata/whoscored.py:823
Method
_validate_page
Validate the page content. Polls for the presence of a table element and checks for IP blocks. Parameters ----------
soccerdata/fbref.py:999
Function
elo
Return a correctly initialized ClubElo instance.
tests/conftest.py:27
Function
espn_seriea
Return a correctly initialized instance of ESPN filtered by league: Serie A.
tests/conftest.py:9
Function
fbref_ligue1
Return a correctly initialized instance of FBref filtered by league: Ligue 1.
tests/conftest.py:21
Function
get_proxy
Return a public proxy.
soccerdata/_common.py:756
next →
1–100 of 201, ranked by callers