python-ballchasing 0.1.20__tar.gz → 0.1.22__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.
- {python-ballchasing-0.1.20/python_ballchasing.egg-info → python-ballchasing-0.1.22}/PKG-INFO +1 -1
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/ballchasing/__init__.py +1 -1
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/ballchasing/api.py +13 -11
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22/python_ballchasing.egg-info}/PKG-INFO +1 -1
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/LICENSE +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/README.md +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/ballchasing/constants.py +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/ballchasing/stats_info.tsv +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/ballchasing/util.py +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/SOURCES.txt +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/dependency_links.txt +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/requires.txt +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/top_level.txt +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/setup.cfg +0 -0
- {python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/setup.py +0 -0
|
@@ -28,7 +28,7 @@ __author__ = 'Rolv-Arild Braaten'
|
|
|
28
28
|
__email__ = 'rolv_arild@hotmail.com'
|
|
29
29
|
__copyright__ = 'Copyright (c) 2020 Rolv-Arild Braaten'
|
|
30
30
|
__license__ = 'Apache License 2.0'
|
|
31
|
-
__version__ = '0.1.
|
|
31
|
+
__version__ = '0.1.22'
|
|
32
32
|
__url__ = 'https://github.com/Rolv-Arild/python-ballchasing'
|
|
33
33
|
__download_url__ = 'https://pypi.python.org/pypi/python-ballchasing'
|
|
34
34
|
__description__ = 'A Python wrapper around the Ballchasing API'
|
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
import time
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
from typing import Optional, Iterator, Union, List
|
|
5
|
+
from urllib.parse import parse_qs, urlparse
|
|
5
6
|
|
|
6
7
|
from requests import sessions, Response, ConnectionError
|
|
7
8
|
|
|
@@ -115,7 +116,7 @@ class Api:
|
|
|
115
116
|
replay_before: Optional[Union[str, datetime]] = None,
|
|
116
117
|
count: int = 150,
|
|
117
118
|
sort_by: Optional[AnyReplaySortBy] = None,
|
|
118
|
-
sort_dir:
|
|
119
|
+
sort_dir: AnySortDir = SortDir.DESCENDING,
|
|
119
120
|
deep: bool = False
|
|
120
121
|
) -> Iterator[dict]:
|
|
121
122
|
"""
|
|
@@ -174,9 +175,9 @@ class Api:
|
|
|
174
175
|
if "next" not in d:
|
|
175
176
|
break
|
|
176
177
|
|
|
177
|
-
|
|
178
|
+
next_url = d["next"]
|
|
178
179
|
left -= len(batch)
|
|
179
|
-
params =
|
|
180
|
+
params["after"] = parse_qs(urlparse(next_url).query)["after"][0]
|
|
180
181
|
|
|
181
182
|
def get_replay(self, replay_id: str) -> dict:
|
|
182
183
|
"""
|
|
@@ -196,16 +197,17 @@ class Api:
|
|
|
196
197
|
"""
|
|
197
198
|
self._request(f"/replays/{replay_id}", self._session.patch, json=params)
|
|
198
199
|
|
|
199
|
-
def upload_replay(self, replay_file, visibility: Optional[AnyVisibility] = None) -> dict:
|
|
200
|
+
def upload_replay(self, replay_file, visibility: Optional[AnyVisibility] = None, group: Optional[str] = None) -> dict:
|
|
200
201
|
"""
|
|
201
202
|
Use this API to upload a replay file to ballchasing.com.
|
|
202
203
|
|
|
203
204
|
:param replay_file: replay file to upload.
|
|
204
205
|
:param visibility: to set the visibility of the uploaded replay.
|
|
206
|
+
:param group: to upload the replay to an existing group.
|
|
205
207
|
:return: the result of the POST request.
|
|
206
208
|
"""
|
|
207
209
|
return self._request(f"/v2/upload", self._session.post, files={"file": replay_file},
|
|
208
|
-
params={"visibility": visibility}).json()
|
|
210
|
+
params={"group": group, "visibility": visibility}).json()
|
|
209
211
|
|
|
210
212
|
def delete_replay(self, replay_id: str) -> None:
|
|
211
213
|
"""
|
|
@@ -222,8 +224,8 @@ class Api:
|
|
|
222
224
|
created_before: Optional[Union[str, datetime]] = None,
|
|
223
225
|
created_after: Optional[Union[str, datetime]] = None,
|
|
224
226
|
count: int = 200,
|
|
225
|
-
sort_by:
|
|
226
|
-
sort_dir:
|
|
227
|
+
sort_by: AnyGroupSortBy = GroupSortBy.CREATED,
|
|
228
|
+
sort_dir: AnySortDir = SortDir.DESCENDING
|
|
227
229
|
) -> Iterator[dict]:
|
|
228
230
|
"""
|
|
229
231
|
This endpoint lets you filter and retrieve replay groups.
|
|
@@ -258,14 +260,14 @@ class Api:
|
|
|
258
260
|
if "next" not in d:
|
|
259
261
|
break
|
|
260
262
|
|
|
261
|
-
|
|
263
|
+
next_url = d["next"]
|
|
262
264
|
left -= len(batch)
|
|
263
|
-
params =
|
|
265
|
+
params["after"] = parse_qs(urlparse(next_url).query)["after"][0]
|
|
264
266
|
|
|
265
267
|
def create_group(self,
|
|
266
268
|
name: str,
|
|
267
|
-
player_identification:
|
|
268
|
-
team_identification:
|
|
269
|
+
player_identification: AnyPlayerIdentification,
|
|
270
|
+
team_identification: AnyTeamIdentification,
|
|
269
271
|
parent: Optional[str] = None
|
|
270
272
|
) -> dict:
|
|
271
273
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/requires.txt
RENAMED
|
File without changes
|
{python-ballchasing-0.1.20 → python-ballchasing-0.1.22}/python_ballchasing.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|