rustat-python-api 0.3.3__tar.gz → 0.3.4__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.
- {rustat-python-api-0.3.3/rustat_python_api.egg-info → rustat-python-api-0.3.4}/PKG-INFO +2 -2
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/README.md +1 -1
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api/parser.py +21 -2
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4/rustat_python_api.egg-info}/PKG-INFO +2 -2
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/setup.py +1 -1
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/LICENSE +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/pyproject.toml +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api/__init__.py +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api/config.py +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api/processing.py +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api/urls.py +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api.egg-info/SOURCES.txt +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api.egg-info/dependency_links.txt +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api.egg-info/requires.txt +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api.egg-info/top_level.txt +0 -0
- {rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rustat-python-api
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: A Python wrapper for RuStat API
|
|
5
5
|
Home-page: https://github.com/dailydaniel/rustat-python-api
|
|
6
6
|
Author: Daniel Zholkovsky
|
|
@@ -38,7 +38,7 @@ schedule = parser.get_schedule(team_id, season_id)
|
|
|
38
38
|
keys = list(schedule.keys())
|
|
39
39
|
match_id = keys[-1]
|
|
40
40
|
|
|
41
|
-
events = parser.get_events(match_id, process=True)
|
|
41
|
+
events, subs = parser.get_events(match_id, process=True, return_subs=True)
|
|
42
42
|
|
|
43
43
|
stats = parser.get_match_stats(match_id)
|
|
44
44
|
|
|
@@ -23,7 +23,7 @@ schedule = parser.get_schedule(team_id, season_id)
|
|
|
23
23
|
keys = list(schedule.keys())
|
|
24
24
|
match_id = keys[-1]
|
|
25
25
|
|
|
26
|
-
events = parser.get_events(match_id, process=True)
|
|
26
|
+
events, subs = parser.get_events(match_id, process=True, return_subs=True)
|
|
27
27
|
|
|
28
28
|
stats = parser.get_match_stats(match_id)
|
|
29
29
|
|
|
@@ -90,7 +90,12 @@ class RuStatParser:
|
|
|
90
90
|
for row in data["data"]["row"]
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
def get_events(
|
|
93
|
+
def get_events(
|
|
94
|
+
self,
|
|
95
|
+
match_id: int,
|
|
96
|
+
process: bool = True,
|
|
97
|
+
return_subs: bool = False
|
|
98
|
+
) -> pd.DataFrame | None | tuple[pd.DataFrame, pd.DataFrame]:
|
|
94
99
|
data = self.resp2data(
|
|
95
100
|
self.urls["events"].format(
|
|
96
101
|
user=self.user,
|
|
@@ -109,9 +114,23 @@ class RuStatParser:
|
|
|
109
114
|
|
|
110
115
|
if process:
|
|
111
116
|
df['match_id'] = match_id
|
|
117
|
+
|
|
118
|
+
if return_subs:
|
|
119
|
+
subs = df[df['action_id'] == '14000'][[
|
|
120
|
+
'match_id', 'half', 'second',
|
|
121
|
+
'team_id', 'team_name',
|
|
122
|
+
'opponent_id', 'opponent_name',
|
|
123
|
+
'player_id', 'player_name'
|
|
124
|
+
]].rename(columns={
|
|
125
|
+
'player_id': 'player_id_out',
|
|
126
|
+
'opponent_id': 'player_id_in',
|
|
127
|
+
'player_name': 'player_name_out',
|
|
128
|
+
'opponent_name': 'player_name_in'
|
|
129
|
+
})
|
|
130
|
+
|
|
112
131
|
df = processing(df)
|
|
113
132
|
|
|
114
|
-
return df
|
|
133
|
+
return df, subs if return_subs else df
|
|
115
134
|
|
|
116
135
|
def get_tracking(self, match_id: int) -> pd.DataFrame | None:
|
|
117
136
|
data = self.resp2data(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rustat-python-api
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: A Python wrapper for RuStat API
|
|
5
5
|
Home-page: https://github.com/dailydaniel/rustat-python-api
|
|
6
6
|
Author: Daniel Zholkovsky
|
|
@@ -38,7 +38,7 @@ schedule = parser.get_schedule(team_id, season_id)
|
|
|
38
38
|
keys = list(schedule.keys())
|
|
39
39
|
match_id = keys[-1]
|
|
40
40
|
|
|
41
|
-
events = parser.get_events(match_id, process=True)
|
|
41
|
+
events, subs = parser.get_events(match_id, process=True, return_subs=True)
|
|
42
42
|
|
|
43
43
|
stats = parser.get_match_stats(match_id)
|
|
44
44
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rustat-python-api-0.3.3 → rustat-python-api-0.3.4}/rustat_python_api.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|