MCPcopy Create free account

hub / github.com/probberechts/soccerdata / functions

Functions201 in github.com/probberechts/soccerdata

↓ 85 callersMethodget
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 callersMethodparse
Convert a string or int to a standard season format.
soccerdata/_common.py:99
↓ 40 callersFunction_as_int
(value: Any)
soccerdata/understat.py:750
↓ 20 callersMethod_is_complete
Check if a season is complete.
soccerdata/fbref.py:133
↓ 19 callersFunction_as_float
(value: Any)
soccerdata/understat.py:743
↓ 17 callersFunction_as_str
(value: Any)
soccerdata/understat.py:757
↓ 11 callersFunction_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 callersMethodread_seasons
Retrieve the selected seasons for the selected leagues. Parameters ---------- split_up_big5: bool If True, it wil
soccerdata/fbref.py:190
↓ 8 callersFunction_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 callersMethodread_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 callersMethod_all_leagues
Return a dict mapping all canonical league IDs to source league IDs.
soccerdata/_common.py:374
↓ 6 callersMethodread_leagues
Retrieve selected leagues from the datasource. Parameters ---------- split_up_big5: bool If True, it will load th
soccerdata/fbref.py:145
↓ 6 callersMethodread_schedule
Retrieve the game schedule for the selected leagues and seasons. Parameters ---------- force_cache : bool By def
soccerdata/espn.py:74
↓ 5 callersMethodread_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 callersMethodread_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 callersFunctionadd_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 callersMethodread_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 callersMethodread_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 callersMethodread_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 callersMethodread_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 callersMethodread_versions
Retrieve available FIFA releases and rating updates. Parameters ---------- max_age : int for age in days, or timedelta object
soccerdata/sofifa.py:125
↓ 3 callersMethod_check_dataframe
Check if the dataframe has the expected structure.
tests/test_ClubElo.py:16
↓ 3 callersMethod_ensure_cookies
Ensure the session has cookies from the homepage.
soccerdata/understat.py:90
↓ 3 callersMethod_parse_teams
Parse the teams from a match summary page. Parameters ---------- tree : etree.ElementTree The match summary page.
soccerdata/fbref.py:685
↓ 3 callersFunction_parse_url
Parse a URL from WhoScored. Parameters ---------- url : str URL to parse. Raises ------ ValueError If the UR
soccerdata/whoscored.py:76
↓ 3 callersMethod_read_league_season
( self, url: str, league_id: int, season_id: int, no_cache: bool = False )
soccerdata/understat.py:657
↓ 3 callersMethod_request_api
Make an API request with proper headers and caching.
soccerdata/understat.py:706
↓ 3 callersFunctionadd_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 callersMethodread_lineup
Retrieve lineups for the selected leagues and seasons. Parameters ---------- match_id : int or list of int, optional
soccerdata/espn.py:210
↓ 3 callersMethodread_players
Retrieve all players for the selected leagues. Parameters ---------- team: str or list of str, optional Team(s) t
soccerdata/sofifa.py:221
↓ 3 callersMethodread_schedule
Retrieve the game schedule for the selected leagues and seasons. Parameters ---------- force_cache : bool By def
soccerdata/fbref.py:611
↓ 3 callersMethodread_seasons
Retrieve the selected seasons for the selected leagues. Returns ------- pd.DataFrame
soccerdata/sofascore.py:102
↓ 3 callersMethodread_seasons
Retrieve the selected seasons from the datasource. Returns ------- pd.DataFrame
soccerdata/understat.py:134
↓ 3 callersMethodread_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 callersMethod__init__
Create a new data reader.
soccerdata/_common.py:221
↓ 2 callersMethod_check_dataframe
Check if the dataframe has the expected structure.
tests/test_ClubElo.py:56
↓ 2 callersMethod_extract_team_name
Extract team name from tmpl HTML.
soccerdata/understat.py:728
↓ 2 callersMethod_init_session
(self, headers: Optional[dict[str, str]] = None)
soccerdata/_common.py:493
↓ 2 callersMethod_init_webdriver
Start the Selenium driver.
soccerdata/_common.py:576
↓ 2 callersFunction_parse_csv
(data: IO[bytes])
soccerdata/clubelo.py:18
↓ 2 callersMethod_read_leagues
(self, no_cache: bool = False)
soccerdata/understat.py:649
↓ 2 callersMethod_read_match
(self, url: str, match_id: int)
soccerdata/understat.py:676
↓ 2 callersMethod_select_matches
( self, df_schedule: pd.DataFrame, match_id: Optional[Union[int, list[int]]] = None,
soccerdata/understat.py:634
↓ 2 callersMethodavailable_leagues
Return a list of league IDs available for this source.
soccerdata/_common.py:369
↓ 2 callersMethodfrom_league
Return the default season code for a league. Parameters ---------- league : str The league to consider.
soccerdata/_common.py:40
↓ 2 callersMethodfrom_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 callersMethodread_leagues
Retrieve selected leagues from the datasource. Returns ------- pd.DataFrame
soccerdata/sofifa.py:94
↓ 2 callersMethodread_matchsheet
Retrieve match sheets for the selected leagues and seasons. Parameters ---------- match_id : int or list of int, optional
soccerdata/espn.py:139
↓ 2 callersMethodread_schedule
Retrieve the game schedule for the selected leagues and seasons. Parameters ---------- force_cache : bool By def
soccerdata/whoscored.py:326
↓ 2 callersMethodread_schedule
Retrieve the matches for the selected leagues and seasons. Parameters ---------- include_matches_without_data : bool
soccerdata/understat.py:180
↓ 2 callersFunctionto_snake
(name: str)
soccerdata/_common.py:737
↓ 1 callersMethod_all_leagues
Return a dict mapping all canonical league IDs to source league IDs.
soccerdata/fbref.py:121
↓ 1 callersFunction_as_bool
(value: Any)
soccerdata/understat.py:736
↓ 1 callersMethod_download_and_save
Download data at `url` to `filepath`. Parameters ---------- url : str URL to download. filepath : Path, o
soccerdata/_common.py:345
↓ 1 callersFunction_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 callersMethod_is_cached
Check if `filepath` contains valid cached data. Parameters ---------- filepath : Path, optional Path where file s
soccerdata/_common.py:299
↓ 1 callersFunction_parse_csv
(raw_data: IO[bytes], lkey: str, skey: str)
soccerdata/match_history.py:16
↓ 1 callersMethod_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 callersFunctioncheck_proxy
Check if proxy is working.
soccerdata/_common.py:798
↓ 1 callersFunctionmake_game_id
Return a game id based on date, home and away team.
soccerdata/_common.py:663
↓ 1 callersMethodread_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 callersMethodread_league_table
Retrieve the league table for the selected leagues. Parameters ---------- force_cache : bool By default no cache
soccerdata/sofascore.py:130
↓ 1 callersMethodread_leagues
Retrieve the selected leagues from the datasource. Returns ------- pd.DataFrame
soccerdata/whoscored.py:179
↓ 1 callersMethodread_leagues
Retrieve the selected leagues from the datasource. Returns ------- pd.DataFrame
soccerdata/sofascore.py:73
↓ 1 callersMethodread_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 callersMethodread_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 callersMethodread_season_stages
Retrieve the season stages for the selected leagues. Parameters ---------- force_cache : bool By default no cach
soccerdata/whoscored.py:256
↓ 1 callersMethodread_seasons
Retrieve the selected seasons for the selected leagues. Returns ------- pd.DataFrame
soccerdata/whoscored.py:213
↓ 1 callersMethodread_team_ratings
Retrieve ratings for all teams in the selected leagues. Returns ------- pd.DataFrame
soccerdata/sofifa.py:294
↓ 1 callersMethodread_teams
Retrieve all teams for the selected leagues. Returns ------- pd.DataFrame
soccerdata/sofifa.py:170
↓ 1 callersFunctionsafe_xpath_text
(node: _Element, xpath_expr: str, warn: Optional[str] = None)
soccerdata/_common.py:808
↓ 1 callersFunctionstandardize_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
Functionelo
Return a correctly initialized ClubElo instance.
tests/conftest.py:27
Functionespn_seriea
Return a correctly initialized instance of ESPN filtered by league: Serie A.
tests/conftest.py:9
Functionfbref_ligue1
Return a correctly initialized instance of FBref filtered by league: Ligue 1.
tests/conftest.py:21
Functionget_proxy
Return a public proxy.
soccerdata/_common.py:756
next →1–100 of 201, ranked by callers