File tree Expand file tree Collapse file tree 2 files changed +47
-4
lines changed
Expand file tree Collapse file tree 2 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 2727# print some info
2828print (tournament .league .name , tournament .league .slug )
2929
30- # Get the current filter for getting the matches
31- filter : PromiedosTypes .TournamentFilter = tournament .current_filter ()
32- print ("Current filter is" , filter .name )
30+ # Get the current stage for getting the matches
31+ stage : PromiedosTypes .Stage = tournament .current_stage ()
32+ print ("Current stage is" , stage .name )
3333
3434# Get the matches for the tournament
3535matches : list [PromiedosTypes .Match ] = client .get_tournament_matchs (
36- tournament .league .id , filter .id
36+ tournament .league .id , stage .id
3737)
3838
3939# Print the matches
Original file line number Diff line number Diff line change 1+ """
2+ In this example we will get all the stages of a tournament
3+ also we will get the matches of the first stage.
4+
5+ Output example:
6+
7+ Fecha 1 False
8+ Fecha 2 False
9+ Fecha 3 False
10+ Fecha 4 False
11+ Fecha 5 False
12+ Fecha 6 False
13+ Fecha 7 False
14+ Fecha 8 False
15+ Playoff False
16+ Octavos de Final False
17+ Cuartos De Final True
18+
19+ Monaco vs Aston Villa
20+ Atalanta vs Sturm Graz
21+ Slovan Bratislava vs Stuttgart
22+ and more...
23+
24+ """
25+ from esd import PromiedosClient , PromiedosTypes
26+
27+ client = PromiedosClient ()
28+
29+ # "fhc" is the ID of uefa champions league
30+ tournament : PromiedosTypes .Tournament = client .get_tournament ("fhc" )
31+
32+ # get all stages
33+ stages : list [PromiedosTypes .Stage ] = tournament .stages
34+
35+ # print the stages
36+ for stage in stages :
37+ print (stage .name , stage .selected )
38+
39+ # now we will use the first stage
40+ stage = stages [0 ]
41+ matches = client .get_tournament_matchs (tournament .league .id , stage .id )
42+ for match in matches :
43+ print (match .home_team .name , "vs" , match .away_team .name )
You can’t perform that action at this time.
0 commit comments