datafc 1.3.0__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {datafc-1.3.0 → datafc-1.4.0}/PKG-INFO +176 -16
  2. {datafc-1.3.0 → datafc-1.4.0}/README.md +175 -15
  3. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_coordinates_data.py +1 -1
  4. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_goal_networks_data.py +1 -1
  5. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_lineups_data.py +1 -1
  6. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_match_data.py +40 -2
  7. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_match_odds_data.py +1 -1
  8. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_match_stats_data.py +1 -1
  9. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_momentum_data.py +1 -1
  10. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_past_matches_data.py +42 -4
  11. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_shots_data.py +1 -1
  12. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_standings_data.py +1 -1
  13. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/fetch_substitutions_data.py +1 -1
  14. datafc-1.4.0/datafc/utils/_config.py +25 -0
  15. {datafc-1.3.0 → datafc-1.4.0}/datafc.egg-info/PKG-INFO +176 -16
  16. {datafc-1.3.0 → datafc-1.4.0}/setup.py +1 -1
  17. datafc-1.3.0/datafc/utils/_config.py +0 -8
  18. {datafc-1.3.0 → datafc-1.4.0}/LICENSE +0 -0
  19. {datafc-1.3.0 → datafc-1.4.0}/datafc/__init__.py +0 -0
  20. {datafc-1.3.0 → datafc-1.4.0}/datafc/sofascore/__init__.py +0 -0
  21. {datafc-1.3.0 → datafc-1.4.0}/datafc/utils/__init__.py +0 -0
  22. {datafc-1.3.0 → datafc-1.4.0}/datafc/utils/_save_files.py +0 -0
  23. {datafc-1.3.0 → datafc-1.4.0}/datafc/utils/_setup_webdriver.py +0 -0
  24. {datafc-1.3.0 → datafc-1.4.0}/datafc.egg-info/SOURCES.txt +0 -0
  25. {datafc-1.3.0 → datafc-1.4.0}/datafc.egg-info/dependency_links.txt +0 -0
  26. {datafc-1.3.0 → datafc-1.4.0}/datafc.egg-info/requires.txt +0 -0
  27. {datafc-1.3.0 → datafc-1.4.0}/datafc.egg-info/top_level.txt +0 -0
  28. {datafc-1.3.0 → datafc-1.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datafc
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: A scalable Python library for fetching, processing, and exporting structured football match data.
5
5
  Home-page: https://github.com/urazakgul/datafc
6
6
  Author: Uraz Akgül
@@ -14,7 +14,7 @@ Requires-Python: >=3.8
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
 
17
- # datafc v1.3.0
17
+ # datafc v1.4.0
18
18
 
19
19
  ## Overview
20
20
 
@@ -53,7 +53,7 @@ pip install git+https://github.com/urazakgul/datafc.git
53
53
  To install a specific version of `datafc`, use:
54
54
 
55
55
  ```bash
56
- pip install datafc==1.3.0
56
+ pip install datafc==1.4.0
57
57
  ```
58
58
 
59
59
  If you already have `datafc` installed and want to upgrade to the latest version, run:
@@ -164,15 +164,52 @@ match_df = match_data(
164
164
  )
165
165
 
166
166
  print(match_df)
167
+
168
+ uefa_match_df = match_data(
169
+ tournament_id=7,
170
+ season_id=61644,
171
+ week_number=5,
172
+ tournament_type="uefa",
173
+ tournament_stage="round_of_16",
174
+ data_source="sofascore",
175
+ enable_json_export=True,
176
+ enable_excel_export=True
177
+ )
178
+
179
+ print(uefa_match_df)
167
180
  ```
168
181
 
169
182
  Parameters:
170
183
 
171
184
  * `tournament_id` (int): The unique identifier for the tournament.
172
185
  * `season_id` (int): The unique identifier for the season.
173
- * `week_number` (int): The matchweek number within the season.
186
+ * `week_number` (int): The matchweek number within the season. The applicable week numbers depend on the tournament and stage, as outlined below for the 2024/25 season:
187
+ * UCL, UEL, UECL, and UNL:
188
+ * `qualification_round`: 1, 2, 3
189
+ * `qualification_playoff`: 636
190
+ * `group_stage_week`: 1, 2, 3, ..., 8 (for UNL, up to 6)
191
+ * `playoff_round`: 636
192
+ * `round_of_16`: 5
193
+ * `quarterfinals`: 27
194
+ * `semifinals`: 28
195
+ * `final`: 29
196
+ * Domestic Leagues:
197
+ * Use the corresponding matchweek number (e.g., for the 10th week of the season, enter `week_number=10`).
198
+ * `tournament_type` (str, optional): The tournament type (`uefa`). If `None`, assumes league format.
199
+ * `tournament_stage` (str, optional): The specific stage of the tournament. Available options for UEFA tournaments:
200
+ * `preliminary_final`
201
+ * `preliminary_final`
202
+ * `qualification_round`
203
+ * `qualification_playoff`
204
+ * `group_stage_week`
205
+ * `playoff_round`
206
+ * `round_of_16`
207
+ * `quarterfinals`
208
+ * `semifinals`
209
+ * `match_for_3rd_place`
210
+ * `final`
174
211
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
175
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
212
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
176
213
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
177
214
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
178
215
 
@@ -223,13 +260,22 @@ match_odds_df = match_odds_data(
223
260
  )
224
261
 
225
262
  print(match_odds_df)
263
+
264
+ uefa_match_odds_df = match_odds_data(
265
+ match_df=uefa_match_df,
266
+ data_source="sofascore",
267
+ enable_json_export=True,
268
+ enable_excel_export=True
269
+ )
270
+
271
+ print(uefa_match_odds_df)
226
272
  ```
227
273
 
228
274
  Parameters:
229
275
 
230
276
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
231
277
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
232
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
278
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
233
279
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
234
280
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
235
281
 
@@ -270,13 +316,22 @@ match_stats_df = match_stats_data(
270
316
  )
271
317
 
272
318
  print(match_stats_df)
319
+
320
+ uefa_match_stats_df = match_stats_data(
321
+ match_df=uefa_match_df,
322
+ data_source="sofascore",
323
+ enable_json_export=True,
324
+ enable_excel_export=True
325
+ )
326
+
327
+ print(uefa_match_stats_df)
273
328
  ```
274
329
 
275
330
  Parameters:
276
331
 
277
332
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
278
333
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
279
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
334
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
280
335
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
281
336
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
282
337
 
@@ -314,13 +369,22 @@ momentum_df = momentum_data(
314
369
  )
315
370
 
316
371
  print(momentum_df)
372
+
373
+ uefa_momentum_df = momentum_data(
374
+ match_df=uefa_match_df,
375
+ data_source="sofascore",
376
+ enable_json_export=True,
377
+ enable_excel_export=True
378
+ )
379
+
380
+ print(uefa_momentum_df)
317
381
  ```
318
382
 
319
383
  Parameters:
320
384
 
321
385
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
322
386
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
323
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
387
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
324
388
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
325
389
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
326
390
 
@@ -357,15 +421,52 @@ past_matches_df = past_matches_data(
357
421
  )
358
422
 
359
423
  print(past_matches_df)
424
+
425
+ uefa_past_matches_df = past_matches_data(
426
+ tournament_id=7,
427
+ season_id=61644,
428
+ week_number=5,
429
+ tournament_type="uefa",
430
+ tournament_stage="round_of_16",
431
+ data_source="sofascore",
432
+ enable_json_export=True,
433
+ enable_excel_export=True
434
+ )
435
+
436
+ print(uefa_past_matches_df)
360
437
  ```
361
438
 
362
439
  Parameters:
363
440
 
364
441
  * `tournament_id` (int): The unique identifier for the tournament.
365
442
  * `season_id` (int): The unique identifier for the season.
366
- * `week_number` (int): The matchweek number within the season.
443
+ * `week_number` (int): The matchweek number within the season. The applicable week numbers depend on the tournament and stage, as outlined below for the 2024/25 season:
444
+ * UCL, UEL, UECL, and UNL:
445
+ * `qualification_round`: 1, 2, 3
446
+ * `qualification_playoff`: 636
447
+ * `group_stage_week`: 1, 2, 3, ..., 8 (for UNL, up to 6)
448
+ * `playoff_round`: 636
449
+ * `round_of_16`: 5
450
+ * `quarterfinals`: 27
451
+ * `semifinals`: 28
452
+ * `final`: 29
453
+ * Domestic Leagues:
454
+ * Use the corresponding matchweek number (e.g., for the 10th week of the season, enter `week_number=10`).
455
+ * `tournament_type` (str, optional): The tournament type (`uefa`). If `None`, assumes league format.
456
+ * `tournament_stage` (str, optional): The specific stage of the tournament. Available options for UEFA tournaments:
457
+ * `preliminary_final`
458
+ * `preliminary_final`
459
+ * `qualification_round`
460
+ * `qualification_playoff`
461
+ * `group_stage_week`
462
+ * `playoff_round`
463
+ * `round_of_16`
464
+ * `quarterfinals`
465
+ * `semifinals`
466
+ * `match_for_3rd_place`
467
+ * `final`
367
468
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
368
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
469
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
369
470
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
370
471
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
371
472
 
@@ -418,13 +519,22 @@ lineups_df = lineups_data(
418
519
  )
419
520
 
420
521
  print(lineups_df)
522
+
523
+ uefa_lineups_df = lineups_data(
524
+ match_df=uefa_match_df,
525
+ data_source="sofascore",
526
+ enable_json_export=True,
527
+ enable_excel_export=True
528
+ )
529
+
530
+ print(uefa_lineups_df)
421
531
  ```
422
532
 
423
533
  Parameters:
424
534
 
425
535
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
426
536
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
427
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
537
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
428
538
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
429
539
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
430
540
 
@@ -462,13 +572,22 @@ coordinates_df = coordinates_data(
462
572
  )
463
573
 
464
574
  print(coordinates_df)
575
+
576
+ uefa_coordinates_df = coordinates_data(
577
+ lineups_df=uefa_lineups_df,
578
+ data_source="sofascore",
579
+ enable_json_export=True,
580
+ enable_excel_export=True
581
+ )
582
+
583
+ print(uefa_coordinates_df)
465
584
  ```
466
585
 
467
586
  Parameters:
468
587
 
469
588
  * `lineups_df` (pd.DataFrame): A DataFrame containing player and match metadata, which should be generated by the `lineups_data` function.
470
589
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
471
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
590
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
472
591
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
473
592
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
474
593
 
@@ -506,13 +625,22 @@ substitutions_df = substitutions_data(
506
625
  )
507
626
 
508
627
  print(substitutions_df)
628
+
629
+ uefa_substitutions_df = substitutions_data(
630
+ match_df=uefa_match_df,
631
+ data_source="sofascore",
632
+ enable_json_export=True,
633
+ enable_excel_export=True
634
+ )
635
+
636
+ print(uefa_substitutions_df)
509
637
  ```
510
638
 
511
639
  Parameters:
512
640
 
513
641
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
514
642
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
515
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
643
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
516
644
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
517
645
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
518
646
 
@@ -552,13 +680,22 @@ goal_networks_df = goal_networks_data(
552
680
  )
553
681
 
554
682
  print(goal_networks_df)
683
+
684
+ uefa_goal_networks_df = goal_networks_data(
685
+ match_df=uefa_match_df,
686
+ data_source="sofascore",
687
+ enable_json_export=True,
688
+ enable_excel_export=True
689
+ )
690
+
691
+ print(uefa_goal_networks_df)
555
692
  ```
556
693
 
557
694
  Parameters:
558
695
 
559
696
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
560
697
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
561
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
698
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
562
699
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
563
700
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
564
701
 
@@ -608,13 +745,22 @@ shots_df = shots_data(
608
745
  )
609
746
 
610
747
  print(shots_df)
748
+
749
+ uefa_shots_df = shots_data(
750
+ match_df=uefa_match_df,
751
+ data_source="sofascore",
752
+ enable_json_export=True,
753
+ enable_excel_export=True
754
+ )
755
+
756
+ print(uefa_shots_df)
611
757
  ```
612
758
 
613
759
  Parameters:
614
760
 
615
761
  * `match_df` (pd.DataFrame): A DataFrame containing match metadata, which should be generated by the `match_data` function.
616
762
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
617
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
763
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
618
764
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
619
765
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
620
766
 
@@ -675,6 +821,16 @@ standings_df = standings_data(
675
821
  )
676
822
 
677
823
  print(standings_df)
824
+
825
+ uefa_standings_df = standings_data(
826
+ tournament_id=7,
827
+ season_id=61644,
828
+ data_source="sofascore",
829
+ enable_json_export=True,
830
+ enable_excel_export=True
831
+ )
832
+
833
+ print(uefa_standings_df)
678
834
  ```
679
835
 
680
836
  Parameters:
@@ -682,7 +838,7 @@ Parameters:
682
838
  * `tournament_id` (int): The unique identifier for the tournament.
683
839
  * `season_id` (int): The unique identifier for the season.
684
840
  * `data_source` (str): The data source (`sofavpn` or `sofascore`). Defaults to `sofascore`.
685
- * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to 10.
841
+ * `element_load_timeout` (int): The maximum time (in seconds) to wait for the API response. Defaults to `10`.
686
842
  * `enable_json_export` (bool): If `True`, exports the fetched data as a JSON file. Defaults to `False`.
687
843
  * `enable_excel_export` (bool): If `True`, exports the fetched data as an Excel file. Defaults to `False`.
688
844
 
@@ -710,6 +866,10 @@ Dependencies:
710
866
 
711
867
  ## Changelog
712
868
 
869
+ * v1.4.0
870
+ * Added `tournament_type` and `tournament_stage` parameters to `match_data` and `past_matches_data` functions.
871
+ * Extended support for UEFA tournaments, including UEFA Champions League (UCL), UEFA Europa League (UEL), UEFA Europa Conference League (UECL), and UEFA Nations League (UNL), allowing seamless data fetching across multiple competitions.
872
+
713
873
  * v1.3.0
714
874
  * Added `past_matches_data` function to fetch historical match data.
715
875