esd

EasySoccerData

A Python easy-to-use library for for fetching live football/soccer statsfrom multiple online sources/apis.

Note! This package is not affiliated with any of the sources used to extract data.

Installation

pip install EasySoccerData

Usage

Sofascore

import esd

client = esd.SofascoreClient()
events = client.get_events(live=True)
for event in events:
    print(event)

How to search for matches, teams, tournaments, and players

How to get tournament brackets

How to get live match statistics

Check out Sofascore module examples

FBRef

import esd

client = esd.FBrefClient()
matchs = client.get_matchs()
for match in matchs:
    print(match)

Check out FBref module examples

Promiedos

import esd

client = esd.PromiedosClient()
events = client.get_events()
for event in events:
    print(event)

Check out Promiedos module examples

Supported modules

Name Implemented
Sofascore ✔️
FBref ✔️
Promiedos ✔️
Understat

...

Keep in mind that it is still under active development.

Constributions

All constributions, bug reports or fixes and ideas are welcome.

 1"""
 2# EasySoccerData
 3
 4A Python easy-to-use library for for fetching live
 5football/soccer statsfrom multiple online sources/apis.
 6
 7Note! This package is not affiliated with
 8any of the sources used to extract data.
 9
10.. include:: ../READMEdoc.md
11   :start-line: 17
12"""
13
14from .sofascore import SofascoreClient, types as SofascoreTypes
15from .promiedos import PromiedosClient, types as PromiedosTypes
16from .fbref import FBrefClient, types as FBrefTypes
17
18
19__all__ = [
20    "SofascoreClient",
21    "SofascoreTypes",
22    "PromiedosClient",
23    "PromiedosTypes",
24    "FBrefClient",
25    "FBrefTypes",
26]
27
28__version__ = "0.0.8"
29__description__ = (
30    "A simple python package for extracting real-time soccer data "
31    "from diverse online sources, providing essential statistics and insights."
32)
33__author__ = "Manuel Cabral"
34__title__ = "EasySoccerData"
35__license__ = "GPL-3.0"
class SofascoreClient:
 29class SofascoreClient:
 30    """
 31    Client for interacting with the Sofascore website.
 32    This class provides methods to access and retrieve data from Sofascore.
 33    """
 34
 35    def __init__(self, browser_path: str = None):
 36        """
 37        Initializes a new instance of the SofascoreClient.
 38
 39        Required for interacting with the Sofascore website.
 40
 41        Args:
 42            browser_path (str): The path to the browser executable.
 43                If None, uses Google Chrome by default.
 44        """
 45        self.__service = SofascoreService(browser_path)
 46
 47    def close(self) -> None:
 48        """
 49        Close the browser and release resources.
 50        """
 51        self.__service.close()
 52
 53    def get_events(self, date: str = None, live: bool = False) -> list[Event]:
 54        """
 55        Get the scheduled events.
 56
 57        Args:
 58            date (str): The date of the events in the format "YYYY-MM-DD".
 59            live (bool): Whether to get the live events (more precise).
 60
 61        Returns:
 62            list[Event]: The scheduled events.
 63        """
 64        if live:
 65            return self.__service.get_live_events()
 66        return self.__service.get_events(date)
 67
 68    def get_event(self, event_id: int) -> Event:
 69        """
 70        Get the event information.
 71
 72        Args:
 73            event_id (int): The event id.
 74
 75        Returns:
 76            Event: The event information.
 77        """
 78        return self.__service.get_event(event_id)
 79
 80    def get_player(self, player_id: int) -> Player:
 81        """
 82        Get the player information.
 83
 84        Args:
 85            player_id (int): The player id.
 86
 87        Returns:
 88            Player: The player information.
 89        """
 90        return self.__service.get_player(player_id)
 91
 92    def get_match_incidents(self, event_id: int) -> list[Incident]:
 93        """
 94        Get the events of a match.
 95
 96        Args:
 97            event_id (int): The event id.
 98
 99        Returns:
100            list[Incident]: The match incidents.
101        """
102        return self.__service.get_match_incidents(event_id)
103
104    def get_match_top_players(self, event_id: int) -> TopPlayersMatch:
105        """
106        Get the top players of a match.
107
108        Args:
109            event_id (int): The event id.
110
111        Returns:
112            TopPlayersMatch: The match top players.
113        """
114        return self.__service.get_match_top_players(event_id)
115
116    def get_match_comments(self, event_id: int) -> list[Comment]:
117        """
118        Get the comments of a match.
119
120        Args:
121            event_id (int): The event id.
122
123        Returns:
124            list[Comment]: The match comments.
125        """
126        return self.__service.get_match_comments(event_id)
127
128    def get_match_stats(self, event_id: int) -> MatchStats:
129        """
130        Get the match statistics by event id.
131
132        Args:
133            event_id (int): The event id (also known as match id).
134
135        Returns:
136            MatchStats: The match statistics.
137        """
138        return self.__service.get_match_stats(event_id)
139
140    def get_match_lineups(self, event_id: int) -> Lineups:
141        """
142        Get the match lineups.
143
144        Args:
145            event_id (int): The event id.
146
147        Returns:
148            Lineups: The match lineups.
149        """
150        return self.__service.get_match_lineups(event_id)
151
152    def get_match_shots(self, event_id: int) -> list[Shot]:
153        """
154        Get the shots of a match.
155
156        Args:
157            event_id (int): The event id.
158
159        Returns:
160            list[Shot]: The match shots.
161        """
162        return self.__service.get_match_shots(event_id)
163
164    def get_team(self, team_id: int) -> Team:
165        """
166        Get detailed information about a team.
167
168        Args:
169            team_id (int): The team id.
170
171        Returns:
172            TeamEx: The team information.
173        """
174        team: Team = self.__service.get_team(team_id)
175        players: list[Player] = self.__service.get_team_players(team_id)
176        team.players = players
177        return team
178
179    def get_team_players(self, team_id: int) -> list[Player]:
180        """
181        Get the players of a team.
182
183        Args:
184            team_id (int): The team id.
185
186        Returns:
187            list[Player]: The players of the team.
188        """
189        return self.__service.get_team_players(team_id)
190
191    def get_team_events(
192        self, team_id: int, upcoming: bool = False, page: int = 0
193    ) -> list[Event]:
194        """
195        Get the events (matchs) of a team.
196
197        Args:
198            team_id (int): The team id.
199            upcoming (bool): Whether to get the upcoming events.
200            page (int): The page number.
201
202        Returns:
203            list[Event]: The events of the team.
204        """
205        return self.__service.get_team_events(team_id, upcoming, page)
206
207    def get_tournaments(self, category_id: Category) -> list[Tournament]:
208        """
209        Get the tournaments by category.
210        TODO: maybe add a argument to include seasons.
211
212        Args:
213            category_id (Category): The category id.
214
215        Returns:
216            list[Tournament]: The tournaments.
217        """
218        return self.__service.get_tournaments_by_category(category_id)
219
220    def get_tournament_seasons(self, tournament_id: int) -> list[Season]:
221        """
222        Get the seasons of a tournament.
223
224        Args:
225            tournament_id (int): The tournament id.
226
227        Returns:
228            list[Season]: The seasons of the tournament.
229        """
230        return self.__service.get_tournament_seasons(tournament_id)
231
232    def get_tournament_brackets(
233        self, tournament_id: int | Tournament, season_id: int | Season
234    ) -> list[Bracket]:
235        """
236        Get the tournament bracket.
237
238        Args:
239            tournament_id (int, Tournament): The tournament id.
240            season_id (int, Season): The season id.
241
242        Returns:
243            list[Bracket]: The tournament bracket.
244        """
245        return self.__service.get_tournament_bracket(tournament_id, season_id)
246
247    def get_tournament_standings(
248        self, tournament_id: int | Tournament, season_id: int | Season
249    ) -> list[Standing]:
250        """
251        Get the tournament standings.
252
253        Args:
254            tournament_id (int, Tournament): The tournament id.
255            season_id (int, Season): The season id.
256
257        Returns:
258            list[Standing]: The tournament standings.
259        """
260        return self.__service.get_tournament_standings(tournament_id, season_id)
261
262    def get_tournament_top_teams(
263        self, tournament_id: int | Tournament, season_id: int | Season
264    ) -> TopTournamentTeams:
265        """
266        Get the top teams of the tournament.
267
268        Args:
269            tournament_id (int, Tournament): The tournament id.
270            season_id (int, Season): The season id.
271
272        Returns:
273            TopTournamentTeams: The top teams of the tournament.
274        """
275        return self.__service.get_tournament_top_teams(tournament_id, season_id)
276
277    def get_tournament_top_players(
278        self, tournament_id: int | Tournament, season_id: int | Season
279    ) -> TopTournamentPlayers:
280        """
281        Get the top players of the tournament.
282
283        Args:
284            tournament_id (int, Tournament): The tournament id.
285            season_id (int, Season): The season id.
286
287        Returns:
288            TopTournamentPlayers: The top players of the tournament.
289        """
290        return self.__service.get_tournament_top_players(tournament_id, season_id)
291
292    def get_tournament_events(
293        self,
294        tournament_id: int | Tournament,
295        season_id: int | Season,
296        upcoming: bool = False,
297        page: int = 0,
298    ) -> list[Event]:
299        """
300        Get the events of the tournament.
301
302        Args:
303            tournament_id (int, Tournament): The tournament id.
304            season_id (int, Season): The season id.
305            upcoming (bool): Whether to get the upcoming events.
306            page (int): The page number.
307
308        Returns:
309            list[Event]: The events of the tournament.
310        """
311        return self.__service.get_tournament_events(
312            tournament_id, season_id, upcoming, page
313        )
314
315    def search(
316        self, query: str, entity: str | EntityType = EntityType.ALL
317    ) -> list[Event | Team | Player | Tournament]:
318        """
319        Search query for matches, teams, players, and tournaments.
320
321        Args:
322            query (str): The search query.
323            entity (str, EntityType): The entity type to search for.
324
325        Returns:
326            list[Event | Team | Player | Tournament]: The search results.
327        """
328        if isinstance(entity, str):
329            entity = EntityType(entity)
330        return self.__service.search(query, entity)

Client for interacting with the Sofascore website. This class provides methods to access and retrieve data from Sofascore.

SofascoreClient(browser_path: str = None)
35    def __init__(self, browser_path: str = None):
36        """
37        Initializes a new instance of the SofascoreClient.
38
39        Required for interacting with the Sofascore website.
40
41        Args:
42            browser_path (str): The path to the browser executable.
43                If None, uses Google Chrome by default.
44        """
45        self.__service = SofascoreService(browser_path)

Initializes a new instance of the SofascoreClient.

Required for interacting with the Sofascore website.

Args: browser_path (str): The path to the browser executable. If None, uses Google Chrome by default.

def close(self) -> None:
47    def close(self) -> None:
48        """
49        Close the browser and release resources.
50        """
51        self.__service.close()

Close the browser and release resources.

def get_events( self, date: str = None, live: bool = False) -> list[esd.sofascore.types.event.Event]:
53    def get_events(self, date: str = None, live: bool = False) -> list[Event]:
54        """
55        Get the scheduled events.
56
57        Args:
58            date (str): The date of the events in the format "YYYY-MM-DD".
59            live (bool): Whether to get the live events (more precise).
60
61        Returns:
62            list[Event]: The scheduled events.
63        """
64        if live:
65            return self.__service.get_live_events()
66        return self.__service.get_events(date)

Get the scheduled events.

Args: date (str): The date of the events in the format "YYYY-MM-DD". live (bool): Whether to get the live events (more precise).

Returns: list[Event]: The scheduled events.

def get_event(self, event_id: int) -> esd.sofascore.types.event.Event:
68    def get_event(self, event_id: int) -> Event:
69        """
70        Get the event information.
71
72        Args:
73            event_id (int): The event id.
74
75        Returns:
76            Event: The event information.
77        """
78        return self.__service.get_event(event_id)

Get the event information.

Args: event_id (int): The event id.

Returns: Event: The event information.

def get_player(self, player_id: int) -> esd.sofascore.types.player.Player:
80    def get_player(self, player_id: int) -> Player:
81        """
82        Get the player information.
83
84        Args:
85            player_id (int): The player id.
86
87        Returns:
88            Player: The player information.
89        """
90        return self.__service.get_player(player_id)

Get the player information.

Args: player_id (int): The player id.

Returns: Player: The player information.

def get_match_incidents(self, event_id: int) -> list[esd.sofascore.types.incident.Incident]:
 92    def get_match_incidents(self, event_id: int) -> list[Incident]:
 93        """
 94        Get the events of a match.
 95
 96        Args:
 97            event_id (int): The event id.
 98
 99        Returns:
100            list[Incident]: The match incidents.
101        """
102        return self.__service.get_match_incidents(event_id)

Get the events of a match.

Args: event_id (int): The event id.

Returns: list[Incident]: The match incidents.

def get_match_top_players(self, event_id: int) -> esd.sofascore.types.top.TopPlayersMatch:
104    def get_match_top_players(self, event_id: int) -> TopPlayersMatch:
105        """
106        Get the top players of a match.
107
108        Args:
109            event_id (int): The event id.
110
111        Returns:
112            TopPlayersMatch: The match top players.
113        """
114        return self.__service.get_match_top_players(event_id)

Get the top players of a match.

Args: event_id (int): The event id.

Returns: TopPlayersMatch: The match top players.

def get_match_comments(self, event_id: int) -> list[esd.sofascore.types.comment.Comment]:
116    def get_match_comments(self, event_id: int) -> list[Comment]:
117        """
118        Get the comments of a match.
119
120        Args:
121            event_id (int): The event id.
122
123        Returns:
124            list[Comment]: The match comments.
125        """
126        return self.__service.get_match_comments(event_id)

Get the comments of a match.

Args: event_id (int): The event id.

Returns: list[Comment]: The match comments.

def get_match_stats(self, event_id: int) -> esd.sofascore.types.match_stats.MatchStats:
128    def get_match_stats(self, event_id: int) -> MatchStats:
129        """
130        Get the match statistics by event id.
131
132        Args:
133            event_id (int): The event id (also known as match id).
134
135        Returns:
136            MatchStats: The match statistics.
137        """
138        return self.__service.get_match_stats(event_id)

Get the match statistics by event id.

Args: event_id (int): The event id (also known as match id).

Returns: MatchStats: The match statistics.

def get_match_lineups(self, event_id: int) -> esd.sofascore.types.lineup.Lineups:
140    def get_match_lineups(self, event_id: int) -> Lineups:
141        """
142        Get the match lineups.
143
144        Args:
145            event_id (int): The event id.
146
147        Returns:
148            Lineups: The match lineups.
149        """
150        return self.__service.get_match_lineups(event_id)

Get the match lineups.

Args: event_id (int): The event id.

Returns: Lineups: The match lineups.

def get_match_shots(self, event_id: int) -> list[esd.sofascore.types.shot.Shot]:
152    def get_match_shots(self, event_id: int) -> list[Shot]:
153        """
154        Get the shots of a match.
155
156        Args:
157            event_id (int): The event id.
158
159        Returns:
160            list[Shot]: The match shots.
161        """
162        return self.__service.get_match_shots(event_id)

Get the shots of a match.

Args: event_id (int): The event id.

Returns: list[Shot]: The match shots.

def get_team(self, team_id: int) -> esd.sofascore.types.team.Team:
164    def get_team(self, team_id: int) -> Team:
165        """
166        Get detailed information about a team.
167
168        Args:
169            team_id (int): The team id.
170
171        Returns:
172            TeamEx: The team information.
173        """
174        team: Team = self.__service.get_team(team_id)
175        players: list[Player] = self.__service.get_team_players(team_id)
176        team.players = players
177        return team

Get detailed information about a team.

Args: team_id (int): The team id.

Returns: TeamEx: The team information.

def get_team_players(self, team_id: int) -> list[esd.sofascore.types.player.Player]:
179    def get_team_players(self, team_id: int) -> list[Player]:
180        """
181        Get the players of a team.
182
183        Args:
184            team_id (int): The team id.
185
186        Returns:
187            list[Player]: The players of the team.
188        """
189        return self.__service.get_team_players(team_id)

Get the players of a team.

Args: team_id (int): The team id.

Returns: list[Player]: The players of the team.

def get_team_events( self, team_id: int, upcoming: bool = False, page: int = 0) -> list[esd.sofascore.types.event.Event]:
191    def get_team_events(
192        self, team_id: int, upcoming: bool = False, page: int = 0
193    ) -> list[Event]:
194        """
195        Get the events (matchs) of a team.
196
197        Args:
198            team_id (int): The team id.
199            upcoming (bool): Whether to get the upcoming events.
200            page (int): The page number.
201
202        Returns:
203            list[Event]: The events of the team.
204        """
205        return self.__service.get_team_events(team_id, upcoming, page)

Get the events (matchs) of a team.

Args: team_id (int): The team id. upcoming (bool): Whether to get the upcoming events. page (int): The page number.

Returns: list[Event]: The events of the team.

def get_tournaments( self, category_id: esd.sofascore.types.categories.Category) -> list[esd.sofascore.types.tournament.Tournament]:
207    def get_tournaments(self, category_id: Category) -> list[Tournament]:
208        """
209        Get the tournaments by category.
210        TODO: maybe add a argument to include seasons.
211
212        Args:
213            category_id (Category): The category id.
214
215        Returns:
216            list[Tournament]: The tournaments.
217        """
218        return self.__service.get_tournaments_by_category(category_id)

Get the tournaments by category. TODO: maybe add a argument to include seasons.

Args: category_id (Category): The category id.

Returns: list[Tournament]: The tournaments.

def get_tournament_seasons(self, tournament_id: int) -> list[esd.sofascore.types.season.Season]:
220    def get_tournament_seasons(self, tournament_id: int) -> list[Season]:
221        """
222        Get the seasons of a tournament.
223
224        Args:
225            tournament_id (int): The tournament id.
226
227        Returns:
228            list[Season]: The seasons of the tournament.
229        """
230        return self.__service.get_tournament_seasons(tournament_id)

Get the seasons of a tournament.

Args: tournament_id (int): The tournament id.

Returns: list[Season]: The seasons of the tournament.

def get_tournament_brackets( self, tournament_id: int | esd.sofascore.types.tournament.Tournament, season_id: int | esd.sofascore.types.season.Season) -> list[esd.sofascore.types.bracket.Bracket]:
232    def get_tournament_brackets(
233        self, tournament_id: int | Tournament, season_id: int | Season
234    ) -> list[Bracket]:
235        """
236        Get the tournament bracket.
237
238        Args:
239            tournament_id (int, Tournament): The tournament id.
240            season_id (int, Season): The season id.
241
242        Returns:
243            list[Bracket]: The tournament bracket.
244        """
245        return self.__service.get_tournament_bracket(tournament_id, season_id)

Get the tournament bracket.

Args: tournament_id (int, Tournament): The tournament id. season_id (int, Season): The season id.

Returns: list[Bracket]: The tournament bracket.

def get_tournament_standings( self, tournament_id: int | esd.sofascore.types.tournament.Tournament, season_id: int | esd.sofascore.types.season.Season) -> list[esd.sofascore.types.standing.Standing]:
247    def get_tournament_standings(
248        self, tournament_id: int | Tournament, season_id: int | Season
249    ) -> list[Standing]:
250        """
251        Get the tournament standings.
252
253        Args:
254            tournament_id (int, Tournament): The tournament id.
255            season_id (int, Season): The season id.
256
257        Returns:
258            list[Standing]: The tournament standings.
259        """
260        return self.__service.get_tournament_standings(tournament_id, season_id)

Get the tournament standings.

Args: tournament_id (int, Tournament): The tournament id. season_id (int, Season): The season id.

Returns: list[Standing]: The tournament standings.

def get_tournament_top_teams( self, tournament_id: int | esd.sofascore.types.tournament.Tournament, season_id: int | esd.sofascore.types.season.Season) -> esd.sofascore.types.top_tournament_teams.TopTournamentTeams:
262    def get_tournament_top_teams(
263        self, tournament_id: int | Tournament, season_id: int | Season
264    ) -> TopTournamentTeams:
265        """
266        Get the top teams of the tournament.
267
268        Args:
269            tournament_id (int, Tournament): The tournament id.
270            season_id (int, Season): The season id.
271
272        Returns:
273            TopTournamentTeams: The top teams of the tournament.
274        """
275        return self.__service.get_tournament_top_teams(tournament_id, season_id)

Get the top teams of the tournament.

Args: tournament_id (int, Tournament): The tournament id. season_id (int, Season): The season id.

Returns: TopTournamentTeams: The top teams of the tournament.

def get_tournament_top_players( self, tournament_id: int | esd.sofascore.types.tournament.Tournament, season_id: int | esd.sofascore.types.season.Season) -> esd.sofascore.types.top_tournament_players.TopTournamentPlayers:
277    def get_tournament_top_players(
278        self, tournament_id: int | Tournament, season_id: int | Season
279    ) -> TopTournamentPlayers:
280        """
281        Get the top players of the tournament.
282
283        Args:
284            tournament_id (int, Tournament): The tournament id.
285            season_id (int, Season): The season id.
286
287        Returns:
288            TopTournamentPlayers: The top players of the tournament.
289        """
290        return self.__service.get_tournament_top_players(tournament_id, season_id)

Get the top players of the tournament.

Args: tournament_id (int, Tournament): The tournament id. season_id (int, Season): The season id.

Returns: TopTournamentPlayers: The top players of the tournament.

def get_tournament_events( self, tournament_id: int | esd.sofascore.types.tournament.Tournament, season_id: int | esd.sofascore.types.season.Season, upcoming: bool = False, page: int = 0) -> list[esd.sofascore.types.event.Event]:
292    def get_tournament_events(
293        self,
294        tournament_id: int | Tournament,
295        season_id: int | Season,
296        upcoming: bool = False,
297        page: int = 0,
298    ) -> list[Event]:
299        """
300        Get the events of the tournament.
301
302        Args:
303            tournament_id (int, Tournament): The tournament id.
304            season_id (int, Season): The season id.
305            upcoming (bool): Whether to get the upcoming events.
306            page (int): The page number.
307
308        Returns:
309            list[Event]: The events of the tournament.
310        """
311        return self.__service.get_tournament_events(
312            tournament_id, season_id, upcoming, page
313        )

Get the events of the tournament.

Args: tournament_id (int, Tournament): The tournament id. season_id (int, Season): The season id. upcoming (bool): Whether to get the upcoming events. page (int): The page number.

Returns: list[Event]: The events of the tournament.

def search( self, query: str, entity: str | esd.sofascore.types.entity.EntityType = <EntityType.ALL: 'all'>) -> list[esd.sofascore.types.event.Event | esd.sofascore.types.team.Team | esd.sofascore.types.player.Player | esd.sofascore.types.tournament.Tournament]:
315    def search(
316        self, query: str, entity: str | EntityType = EntityType.ALL
317    ) -> list[Event | Team | Player | Tournament]:
318        """
319        Search query for matches, teams, players, and tournaments.
320
321        Args:
322            query (str): The search query.
323            entity (str, EntityType): The entity type to search for.
324
325        Returns:
326            list[Event | Team | Player | Tournament]: The search results.
327        """
328        if isinstance(entity, str):
329            entity = EntityType(entity)
330        return self.__service.search(query, entity)

Search query for matches, teams, players, and tournaments.

Args: query (str): The search query. entity (str, EntityType): The entity type to search for.

Returns: list[Event | Team | Player | Tournament]: The search results.

class PromiedosClient:
12class PromiedosClient:
13    """
14    Client for interacting with the Promiedos website.
15    This class provides methods to access and retrieve data from Promiedos.
16    """
17
18    def __init__(self) -> None:
19        """
20        Initializes the Promiedos client.
21        """
22        self.__service = PromiedosService()
23
24    def get_events(self, date: str = "today") -> list[Event]:
25        """
26        Get the events for the given date.
27
28        Args:
29            date (str): The date to get the events. Defaults to "today".
30
31        Returns:
32            list[Event]: The events for the given date.
33        """
34        return self.__service.get_events(date)
35
36    def get_match(self, match_id: str = None, match: Match = None) -> Match:
37        """
38        Get the match for the given slug and match ID.
39
40        Args:
41            match_id (str): The match ID. E.g. "ediecji".
42            Match (Match): The match object.
43
44        Returns:
45            Match: The match for the given slug and match ID.
46        """
47        if not match_id and not match:
48            raise NotMatchIdProvided(
49                "No match ID provided OR no match object provided."
50            )
51        if match:
52            return self.__service.get_match(match.id)
53        return self.__service.get_match(match_id)
54
55    def get_tournament(self, tournament_id: str) -> Tournament:
56        """
57        Get the matches for the given tournament ID.
58
59        Args:
60            tournament_id (str): The tournament ID. E.g. "hc".
61
62        Returns:
63            Tournament: The tournament for the given tournament ID.
64        """
65        return self.__service.get_tournament(tournament_id)
66
67    def get_tournament_matchs(
68        self, tournament_id: str, stage_id: str = None
69    ) -> list[Match]:
70        """
71        Get the matches for the given tournament ID using the stage ID.
72
73        Args:
74            tournament_id (str): The tournament ID. E.g. "hc".
75            stage_id (str): The stage ID.
76        Returns:
77            list[Match]: The matches for the given tournament ID.
78        """
79        return self.__service.get_tournament_matchs(tournament_id, stage_id)

Client for interacting with the Promiedos website. This class provides methods to access and retrieve data from Promiedos.

PromiedosClient()
18    def __init__(self) -> None:
19        """
20        Initializes the Promiedos client.
21        """
22        self.__service = PromiedosService()

Initializes the Promiedos client.

def get_events(self, date: str = 'today') -> list[esd.promiedos.types.event.Event]:
24    def get_events(self, date: str = "today") -> list[Event]:
25        """
26        Get the events for the given date.
27
28        Args:
29            date (str): The date to get the events. Defaults to "today".
30
31        Returns:
32            list[Event]: The events for the given date.
33        """
34        return self.__service.get_events(date)

Get the events for the given date.

Args: date (str): The date to get the events. Defaults to "today".

Returns: list[Event]: The events for the given date.

def get_match( self, match_id: str = None, match: esd.promiedos.types.match.Match = None) -> esd.promiedos.types.match.Match:
36    def get_match(self, match_id: str = None, match: Match = None) -> Match:
37        """
38        Get the match for the given slug and match ID.
39
40        Args:
41            match_id (str): The match ID. E.g. "ediecji".
42            Match (Match): The match object.
43
44        Returns:
45            Match: The match for the given slug and match ID.
46        """
47        if not match_id and not match:
48            raise NotMatchIdProvided(
49                "No match ID provided OR no match object provided."
50            )
51        if match:
52            return self.__service.get_match(match.id)
53        return self.__service.get_match(match_id)

Get the match for the given slug and match ID.

Args: match_id (str): The match ID. E.g. "ediecji". Match (Match): The match object.

Returns: Match: The match for the given slug and match ID.

def get_tournament(self, tournament_id: str) -> esd.promiedos.types.tournament.Tournament:
55    def get_tournament(self, tournament_id: str) -> Tournament:
56        """
57        Get the matches for the given tournament ID.
58
59        Args:
60            tournament_id (str): The tournament ID. E.g. "hc".
61
62        Returns:
63            Tournament: The tournament for the given tournament ID.
64        """
65        return self.__service.get_tournament(tournament_id)

Get the matches for the given tournament ID.

Args: tournament_id (str): The tournament ID. E.g. "hc".

Returns: Tournament: The tournament for the given tournament ID.

def get_tournament_matchs( self, tournament_id: str, stage_id: str = None) -> list[esd.promiedos.types.match.Match]:
67    def get_tournament_matchs(
68        self, tournament_id: str, stage_id: str = None
69    ) -> list[Match]:
70        """
71        Get the matches for the given tournament ID using the stage ID.
72
73        Args:
74            tournament_id (str): The tournament ID. E.g. "hc".
75            stage_id (str): The stage ID.
76        Returns:
77            list[Match]: The matches for the given tournament ID.
78        """
79        return self.__service.get_tournament_matchs(tournament_id, stage_id)

Get the matches for the given tournament ID using the stage ID.

Args: tournament_id (str): The tournament ID. E.g. "hc". stage_id (str): The stage ID. Returns: list[Match]: The matches for the given tournament ID.

class FBrefClient:
11class FBrefClient:
12    """
13    A class to represent the client for interacting with the FBref website.
14    """
15
16    def __init__(self, language: str = "en", proxies: dict = None) -> None:
17        """
18        Initializes the Sofascore client.
19        """
20        self.__service = FBrefService(language=language, proxies=proxies)
21
22    def get_matchs(self, date: str = None) -> list[Match]:
23        """
24        Get the scheduled matchs.
25
26        Args:
27            date (str): The date of the matchs in the format "YYYY-MM-DD".
28
29        Returns:
30            list[Match]: The scheduled matchs.
31        """
32        return self.__service.get_matchs(date)
33
34    def get_match_details(self, match_id: str) -> MatchDetails:
35        """
36        Get the match report.
37
38        Args:
39            match_id (str): The match id.
40
41        Returns:
42            MatchDetails: The match details.
43        """
44        return self.__service.get_match_details(match_id)

A class to represent the client for interacting with the FBref website.

FBrefClient(language: str = 'en', proxies: dict = None)
16    def __init__(self, language: str = "en", proxies: dict = None) -> None:
17        """
18        Initializes the Sofascore client.
19        """
20        self.__service = FBrefService(language=language, proxies=proxies)

Initializes the Sofascore client.

def get_matchs(self, date: str = None) -> list[esd.fbref.types.match.Match]:
22    def get_matchs(self, date: str = None) -> list[Match]:
23        """
24        Get the scheduled matchs.
25
26        Args:
27            date (str): The date of the matchs in the format "YYYY-MM-DD".
28
29        Returns:
30            list[Match]: The scheduled matchs.
31        """
32        return self.__service.get_matchs(date)

Get the scheduled matchs.

Args: date (str): The date of the matchs in the format "YYYY-MM-DD".

Returns: list[Match]: The scheduled matchs.

def get_match_details(self, match_id: str) -> esd.fbref.types.details.MatchDetails:
34    def get_match_details(self, match_id: str) -> MatchDetails:
35        """
36        Get the match report.
37
38        Args:
39            match_id (str): The match id.
40
41        Returns:
42            MatchDetails: The match details.
43        """
44        return self.__service.get_match_details(match_id)

Get the match report.

Args: match_id (str): The match id.

Returns: MatchDetails: The match details.