rustat-python-api 0.1.2__tar.gz → 0.2.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.
- {rustat-python-api-0.1.2/rustat_python_api.egg-info → rustat-python-api-0.2.0}/PKG-INFO +1 -1
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api/parser.py +14 -3
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0/rustat_python_api.egg-info}/PKG-INFO +1 -1
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/setup.py +1 -1
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/LICENSE +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/README.md +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/pyproject.toml +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api/__init__.py +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api/urls.py +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api.egg-info/SOURCES.txt +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api.egg-info/dependency_links.txt +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api.egg-info/requires.txt +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api.egg-info/top_level.txt +0 -0
- {rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/setup.cfg +0 -0
|
@@ -2,12 +2,19 @@ import requests
|
|
|
2
2
|
import pandas as pd
|
|
3
3
|
from collections import defaultdict
|
|
4
4
|
from tqdm import tqdm
|
|
5
|
+
import time
|
|
5
6
|
|
|
6
7
|
from .urls import URLs
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class RuStatParser:
|
|
10
|
-
def __init__(
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
user: str,
|
|
14
|
+
password: str,
|
|
15
|
+
urls: dict = URLs,
|
|
16
|
+
sleep: int = -1
|
|
17
|
+
):
|
|
11
18
|
self.numeric_columns = [
|
|
12
19
|
'id', 'number', 'player_id', 'team_id', 'half', 'second',
|
|
13
20
|
'pos_x', 'pos_y', 'pos_dest_x', 'pos_dest_y', 'len', 'possession_id', 'possession_team_id',
|
|
@@ -18,11 +25,15 @@ class RuStatParser:
|
|
|
18
25
|
self.user = user
|
|
19
26
|
self.password = password
|
|
20
27
|
self.urls = urls
|
|
28
|
+
self.sleep = sleep
|
|
21
29
|
|
|
22
30
|
self.cached_info = {}
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
def resp2data(self, query: str) -> dict:
|
|
33
|
+
|
|
34
|
+
if self.sleep > 0:
|
|
35
|
+
time.sleep(self.sleep)
|
|
36
|
+
|
|
26
37
|
response = requests.get(query)
|
|
27
38
|
return response.json()
|
|
28
39
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rustat-python-api-0.1.2 → rustat-python-api-0.2.0}/rustat_python_api.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|