rustat-python-api 0.4.6__tar.gz → 0.4.8__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 (17) hide show
  1. {rustat-python-api-0.4.6/rustat_python_api.egg-info → rustat-python-api-0.4.8}/PKG-INFO +1 -1
  2. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api/parser.py +14 -0
  3. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api/processing.py +6 -0
  4. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api/urls.py +2 -1
  5. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8/rustat_python_api.egg-info}/PKG-INFO +1 -1
  6. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/setup.py +1 -1
  7. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/LICENSE +0 -0
  8. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/README.md +0 -0
  9. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/pyproject.toml +0 -0
  10. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api/__init__.py +0 -0
  11. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api/config.py +0 -0
  12. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api/models_api.py +0 -0
  13. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api.egg-info/SOURCES.txt +0 -0
  14. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api.egg-info/dependency_links.txt +0 -0
  15. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api.egg-info/requires.txt +0 -0
  16. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/rustat_python_api.egg-info/top_level.txt +0 -0
  17. {rustat-python-api-0.4.6 → rustat-python-api-0.4.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rustat-python-api
3
- Version: 0.4.6
3
+ Version: 0.4.8
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
@@ -192,3 +192,17 @@ class RuStatParser:
192
192
  stats[param_name][team_id] = param_value
193
193
 
194
194
  return stats
195
+
196
+ def get_players_match_stats(self, match_id: int) -> dict:
197
+ data = self.resp2data(
198
+ self.urls["player_match_stats"].format(
199
+ user=self.user,
200
+ password=self.password,
201
+ match_id=match_id
202
+ )
203
+ )
204
+
205
+ if not data:
206
+ return {}
207
+
208
+ return data['team'] if 'team' in data else {}
@@ -21,6 +21,12 @@ def gluing(df: pd.DataFrame) -> pd.DataFrame:
21
21
  df_gb['possession_number'] = df_gb['possession_number'].apply(
22
22
  lambda x: max(x) if isinstance(x, list) else x
23
23
  )
24
+ df_gb['pos_dest_x'] = df_gb['pos_dest_x'].apply(
25
+ lambda x: x[0] if isinstance(x, list) else x
26
+ )
27
+ df_gb['pos_dest_y'] = df_gb['pos_dest_y'].apply(
28
+ lambda x: x[0] if isinstance(x, list) else x
29
+ )
24
30
  df_gb['pos_dest_nan'] = (df_gb['pos_dest_x'].isna() & df_gb['pos_dest_y'].isna()).astype(int)
25
31
  df_gb = df_gb.sort_values(by=['half', 'second', 'possession_number', 'pos_dest_nan']).reset_index(drop=True)
26
32
  return df_gb
@@ -3,5 +3,6 @@ URLs = {
3
3
  "events": "http://feeds.rustatsport.ru/?tpl=36&user={user}&key={password}&match_id={match_id}&start_ms=0&dl=0&lang_id=1&format=json",
4
4
  "match_stats": "http://feeds.rustatsport.ru/?tpl=207&user={user}&key={password}&match_id={match_id}&lang_id=1&format=json",
5
5
  "tournament_teams": "http://feeds.rustatsport.ru/?tpl=32&user={user}&key={password}&tournament_id=2&season_id={season_id}&date_start=&date_end=&lang_id=1&format=json",
6
- "tracking": "https://feeds.rustatsport.ru/?tpl=274&user={user}&key={password}&match_id={match_id}&lang_id=0&format=json"
6
+ "tracking": "https://feeds.rustatsport.ru/?tpl=274&user={user}&key={password}&match_id={match_id}&lang_id=0&format=json",
7
+ "player_match_stats": "http://feeds.rustatsport.ru/?tpl=227&user={user}}&key={password}&match_id={match_id}&lang_id=1&format=json"
7
8
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rustat-python-api
3
- Version: 0.4.6
3
+ Version: 0.4.8
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='rustat-python-api',
5
- version='0.4.6',
5
+ version='0.4.8',
6
6
  description='A Python wrapper for RuStat API',
7
7
  long_description=open('README.md').read(),
8
8
  long_description_content_type='text/markdown',