datafc 2.4.0__tar.gz → 2.6.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.
- {datafc-2.4.0 → datafc-2.6.0}/PKG-INFO +44 -4
- {datafc-2.4.0 → datafc-2.6.0}/README.md +43 -3
- {datafc-2.4.0 → datafc-2.6.0}/datafc/__init__.py +2 -1
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/__init__.py +2 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/_core.py +817 -816
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/_parsers.py +18 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/aio.py +23 -0
- datafc-2.6.0/datafc/sofascore/fetch_formations_data.py +44 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_attribute_overviews_data.py +74 -74
- {datafc-2.4.0 → datafc-2.6.0}/datafc.egg-info/PKG-INFO +44 -4
- {datafc-2.4.0 → datafc-2.6.0}/datafc.egg-info/SOURCES.txt +1 -0
- {datafc-2.4.0 → datafc-2.6.0}/pyproject.toml +1 -1
- {datafc-2.4.0 → datafc-2.6.0}/LICENSE +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/exceptions.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_average_positions_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_coordinates_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_goal_networks_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_incidents_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_league_player_stats_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_lineups_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_match_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_match_details_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_match_h2h_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_match_odds_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_match_stats_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_momentum_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_past_matches_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_career_stats_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_match_log_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_national_team_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_stats_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_player_transfers_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_pregame_form_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_referee_stats_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_search_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_season_rounds_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_seasons_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_shots_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_squad_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_standings_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_substitutions_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_team_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_team_match_history_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_team_stats_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_team_transfers_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/sofascore/fetch_upcoming_matches_data.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/__init__.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_async_client.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_cache.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_client.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_config.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_helpers.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_save_files.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_tournament_info.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc/utils/_validate.py +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc.egg-info/dependency_links.txt +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc.egg-info/requires.txt +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/datafc.egg-info/top_level.txt +0 -0
- {datafc-2.4.0 → datafc-2.6.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datafc
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.6.0
|
|
4
4
|
Summary: Fetch, process, and export structured football data.
|
|
5
5
|
Author-email: Uraz Akgül <urazdev@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,16 +24,27 @@ Requires-Dist: pytest>=8.0; extra == "dev"
|
|
|
24
24
|
Requires-Dist: pytest-mock>=3.12; extra == "dev"
|
|
25
25
|
Dynamic: license-file
|
|
26
26
|
|
|
27
|
-
# datafc v2.
|
|
27
|
+
# datafc v2.6.0
|
|
28
28
|
|
|
29
29
|
## Overview
|
|
30
30
|
|
|
31
|
-
`datafc` fetches, processes, and exports structured football data. It provides **
|
|
31
|
+
`datafc` fetches, processes, and exports structured football data. It provides **35 functions** covering tournament metadata, standings, squad rosters, match fixtures, shots, lineups, player heatmaps, odds, and more — all returning clean `pandas` DataFrames ready for analysis. Sofascore is currently the only supported data source.
|
|
32
32
|
|
|
33
33
|
> **Finding IDs:** `tournament_id` and `season_id` can be discovered two ways:
|
|
34
34
|
> - **From the URL:** navigating to a league page on Sofascore (e.g. `sofascore.com/.../trendyol-super-lig/52#id:63814`) shows `tournament_id=52` and `season_id=63814`.
|
|
35
35
|
> - **Programmatically:** use `search_data("super lig", entity_type="tournament")` to find the tournament ID, then `seasons_data(tournament_id)` to list all available seasons.
|
|
36
36
|
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
If you find <strong>datafc</strong> useful, consider supporting the project ☕<br><br>
|
|
41
|
+
<a href="https://buymeacoffee.com/urazdev">
|
|
42
|
+
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-urazdev-%23FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me A Coffee">
|
|
43
|
+
</a>
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
37
48
|
## What Data Can You Access?
|
|
38
49
|
|
|
39
50
|
### Discovery
|
|
@@ -69,6 +80,7 @@ Dynamic: license-file
|
|
|
69
80
|
|---|---|
|
|
70
81
|
| `match_data` | Fixtures for a matchweek: score, status, home/away teams |
|
|
71
82
|
| `match_details_data` | Referee info (name, cards, games) and venue details per match |
|
|
83
|
+
| `formations_data` | Home and away formation for each match |
|
|
72
84
|
| `match_stats_data` | Aggregate team stats per match (possession, shots, fouls, …) |
|
|
73
85
|
| `match_odds_data` | Pre-match 1/X/2 betting odds |
|
|
74
86
|
| `match_h2h_data` | All-time H2H record between the two teams |
|
|
@@ -580,6 +592,22 @@ Dependencies: `match_data`
|
|
|
580
592
|
|
|
581
593
|
---
|
|
582
594
|
|
|
595
|
+
#### `formations_data`
|
|
596
|
+
|
|
597
|
+
Fetch home and away formation for each match.
|
|
598
|
+
|
|
599
|
+
```python
|
|
600
|
+
from datafc import formations_data
|
|
601
|
+
|
|
602
|
+
df = formations_data(match_df=match_df)
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
Columns: `country`, `tournament`, `season`, `week`, `game_id`, `team` (`home` / `away`), `formation`.
|
|
606
|
+
|
|
607
|
+
Dependencies: `match_data`
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
583
611
|
#### `match_stats_data`
|
|
584
612
|
|
|
585
613
|
Fetch aggregate team statistics (possession, shots, passes, etc.) for each match.
|
|
@@ -817,7 +845,7 @@ squad_df = squad_data(standings_df=standings_df)
|
|
|
817
845
|
df = player_data(squad_df=squad_df)
|
|
818
846
|
```
|
|
819
847
|
|
|
820
|
-
Columns: `player_id`, `player_name`, `date_of_birth`, `age`, `nationality`, `nationality_id`, `height`, `weight`, `preferred_foot`, `jersey_number`, `position`, `market_value`, `market_currency`, `team_id`, `team_name`.
|
|
848
|
+
Columns: `player_id`, `player_name`, `date_of_birth`, `age`, `nationality`, `nationality_id`, `height`, `weight`, `preferred_foot`, `jersey_number`, `position`, `position_detailed`, `market_value`, `market_currency`, `team_id`, `team_name`.
|
|
821
849
|
|
|
822
850
|
Dependencies: `squad_data`
|
|
823
851
|
|
|
@@ -935,6 +963,18 @@ Columns: `referee_id`, `referee_name`, `tournament_id`, `tournament_name`, `stat
|
|
|
935
963
|
|
|
936
964
|
## What's new
|
|
937
965
|
|
|
966
|
+
### v2.6.0
|
|
967
|
+
|
|
968
|
+
- **New function: `formations_data`** — fetches home and away formation for each match. Returns two rows per match (`team`: `home` / `away`) with the formation string (e.g. `4-3-3`).
|
|
969
|
+
|
|
970
|
+
---
|
|
971
|
+
|
|
972
|
+
### v2.5.0
|
|
973
|
+
|
|
974
|
+
- **`player_data` now returns `position_detailed`.** New column containing Sofascore's detailed position list (e.g. `["AM", "MC", "RW"]`) alongside the existing single `position` field.
|
|
975
|
+
|
|
976
|
+
---
|
|
977
|
+
|
|
938
978
|
### v2.4.0
|
|
939
979
|
|
|
940
980
|
- **New function: `player_attribute_overviews_data`** — fetches Sofascore radar attribute snapshots (attacking, technical, tactical, defending, creativity) for each player in a squad. Includes the position-average baseline and previous-year history.
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
# datafc v2.
|
|
1
|
+
# datafc v2.6.0
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
`datafc` fetches, processes, and exports structured football data. It provides **
|
|
5
|
+
`datafc` fetches, processes, and exports structured football data. It provides **35 functions** covering tournament metadata, standings, squad rosters, match fixtures, shots, lineups, player heatmaps, odds, and more — all returning clean `pandas` DataFrames ready for analysis. Sofascore is currently the only supported data source.
|
|
6
6
|
|
|
7
7
|
> **Finding IDs:** `tournament_id` and `season_id` can be discovered two ways:
|
|
8
8
|
> - **From the URL:** navigating to a league page on Sofascore (e.g. `sofascore.com/.../trendyol-super-lig/52#id:63814`) shows `tournament_id=52` and `season_id=63814`.
|
|
9
9
|
> - **Programmatically:** use `search_data("super lig", entity_type="tournament")` to find the tournament ID, then `seasons_data(tournament_id)` to list all available seasons.
|
|
10
10
|
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
If you find <strong>datafc</strong> useful, consider supporting the project ☕<br><br>
|
|
15
|
+
<a href="https://buymeacoffee.com/urazdev">
|
|
16
|
+
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-urazdev-%23FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me A Coffee">
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
11
22
|
## What Data Can You Access?
|
|
12
23
|
|
|
13
24
|
### Discovery
|
|
@@ -43,6 +54,7 @@
|
|
|
43
54
|
|---|---|
|
|
44
55
|
| `match_data` | Fixtures for a matchweek: score, status, home/away teams |
|
|
45
56
|
| `match_details_data` | Referee info (name, cards, games) and venue details per match |
|
|
57
|
+
| `formations_data` | Home and away formation for each match |
|
|
46
58
|
| `match_stats_data` | Aggregate team stats per match (possession, shots, fouls, …) |
|
|
47
59
|
| `match_odds_data` | Pre-match 1/X/2 betting odds |
|
|
48
60
|
| `match_h2h_data` | All-time H2H record between the two teams |
|
|
@@ -554,6 +566,22 @@ Dependencies: `match_data`
|
|
|
554
566
|
|
|
555
567
|
---
|
|
556
568
|
|
|
569
|
+
#### `formations_data`
|
|
570
|
+
|
|
571
|
+
Fetch home and away formation for each match.
|
|
572
|
+
|
|
573
|
+
```python
|
|
574
|
+
from datafc import formations_data
|
|
575
|
+
|
|
576
|
+
df = formations_data(match_df=match_df)
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
Columns: `country`, `tournament`, `season`, `week`, `game_id`, `team` (`home` / `away`), `formation`.
|
|
580
|
+
|
|
581
|
+
Dependencies: `match_data`
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
557
585
|
#### `match_stats_data`
|
|
558
586
|
|
|
559
587
|
Fetch aggregate team statistics (possession, shots, passes, etc.) for each match.
|
|
@@ -791,7 +819,7 @@ squad_df = squad_data(standings_df=standings_df)
|
|
|
791
819
|
df = player_data(squad_df=squad_df)
|
|
792
820
|
```
|
|
793
821
|
|
|
794
|
-
Columns: `player_id`, `player_name`, `date_of_birth`, `age`, `nationality`, `nationality_id`, `height`, `weight`, `preferred_foot`, `jersey_number`, `position`, `market_value`, `market_currency`, `team_id`, `team_name`.
|
|
822
|
+
Columns: `player_id`, `player_name`, `date_of_birth`, `age`, `nationality`, `nationality_id`, `height`, `weight`, `preferred_foot`, `jersey_number`, `position`, `position_detailed`, `market_value`, `market_currency`, `team_id`, `team_name`.
|
|
795
823
|
|
|
796
824
|
Dependencies: `squad_data`
|
|
797
825
|
|
|
@@ -909,6 +937,18 @@ Columns: `referee_id`, `referee_name`, `tournament_id`, `tournament_name`, `stat
|
|
|
909
937
|
|
|
910
938
|
## What's new
|
|
911
939
|
|
|
940
|
+
### v2.6.0
|
|
941
|
+
|
|
942
|
+
- **New function: `formations_data`** — fetches home and away formation for each match. Returns two rows per match (`team`: `home` / `away`) with the formation string (e.g. `4-3-3`).
|
|
943
|
+
|
|
944
|
+
---
|
|
945
|
+
|
|
946
|
+
### v2.5.0
|
|
947
|
+
|
|
948
|
+
- **`player_data` now returns `position_detailed`.** New column containing Sofascore's detailed position list (e.g. `["AM", "MC", "RW"]`) alongside the existing single `position` field.
|
|
949
|
+
|
|
950
|
+
---
|
|
951
|
+
|
|
912
952
|
### v2.4.0
|
|
913
953
|
|
|
914
954
|
- **New function: `player_attribute_overviews_data`** — fetches Sofascore radar attribute snapshots (attacking, technical, tactical, defending, creativity) for each player in a squad. Includes the position-average baseline and previous-year history.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__version__ = "2.
|
|
1
|
+
__version__ = "2.6.0"
|
|
2
2
|
|
|
3
3
|
from .sofascore import *
|
|
4
4
|
from .exceptions import (
|
|
@@ -36,6 +36,7 @@ __all__ = [
|
|
|
36
36
|
# Matchweek
|
|
37
37
|
"match_data",
|
|
38
38
|
"match_details_data",
|
|
39
|
+
"formations_data",
|
|
39
40
|
"match_stats_data",
|
|
40
41
|
"match_odds_data",
|
|
41
42
|
"match_h2h_data",
|
|
@@ -3,6 +3,7 @@ from .fetch_match_stats_data import match_stats_data
|
|
|
3
3
|
from .fetch_standings_data import standings_data
|
|
4
4
|
from .fetch_shots_data import shots_data
|
|
5
5
|
from .fetch_goal_networks_data import goal_networks_data
|
|
6
|
+
from .fetch_formations_data import formations_data
|
|
6
7
|
from .fetch_lineups_data import lineups_data
|
|
7
8
|
from .fetch_coordinates_data import coordinates_data
|
|
8
9
|
from .fetch_substitutions_data import substitutions_data
|
|
@@ -47,6 +48,7 @@ __all__ = [
|
|
|
47
48
|
"substitutions_data",
|
|
48
49
|
"incidents_data",
|
|
49
50
|
"match_details_data",
|
|
51
|
+
"formations_data",
|
|
50
52
|
"upcoming_matches_data",
|
|
51
53
|
"team_match_history_data",
|
|
52
54
|
"goal_networks_data",
|