python-ballchasing 0.5.0__py3-none-any.whl → 0.5.1__py3-none-any.whl

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.
ballchasing/api.py CHANGED
@@ -207,6 +207,7 @@ class BallchasingApi:
207
207
  deep: bool = False,
208
208
  typed: bool | None = None,
209
209
  deduplicate: bool = False,
210
+ disable_prefetch: bool | None = None,
210
211
  ) -> Iterator[dict | ShallowReplay | DeepReplay]:
211
212
  """
212
213
  This endpoint lets you filter and retrieve replays. The implementation returns an iterator.
@@ -242,6 +243,7 @@ class BallchasingApi:
242
243
  :param deep: whether to get full stats for each replay (will be much slower).
243
244
  :param typed: whether to return a typed object (default is self.typed).
244
245
  :param deduplicate: whether to deduplicate replays that seem to be the same game.
246
+ :param disable_prefetch: whether to disable prefetching replays.
245
247
  :return: an iterator over the replays returned by the API.
246
248
  """
247
249
  url = f"{self.base_url}/replays"
@@ -256,7 +258,10 @@ class BallchasingApi:
256
258
  if typed is None:
257
259
  typed = self.typed
258
260
 
259
- iterator = self._iterable_from_request(url, params, prefetch=not deep)
261
+ if disable_prefetch is None:
262
+ disable_prefetch = deep
263
+
264
+ iterator = self._iterable_from_request(url, params, prefetch=not disable_prefetch)
260
265
  if deep:
261
266
  iterator = (self.get_replay(r["id"]) for r in iterator)
262
267
  if deduplicate:
@@ -336,6 +341,7 @@ class BallchasingApi:
336
341
  sort_dir: AnySortDir = SortDir.DESCENDING,
337
342
  deep: bool = False,
338
343
  typed: bool | None = None,
344
+ disable_prefetch: bool | None = None,
339
345
  ) -> Iterator[dict | ShallowGroup | DeepGroup]:
340
346
  """
341
347
  This endpoint lets you filter and retrieve replay groups.
@@ -354,12 +360,17 @@ class BallchasingApi:
354
360
  :param sort_dir: Sort direction.
355
361
  :param deep: whether to get full stats for each group (will be much slower).
356
362
  :param typed: whether to return a typed object (default is self.typed).
363
+ :param disable_prefetch: whether to disable prefetching.
357
364
  :return: an iterator over the groups returned by the API.
358
365
  """
359
366
  url = f"{self.base_url}/groups/"
360
367
  params = {"name": name, "creator": creator, "group": group, "created-before": to_rfc3339(created_before),
361
368
  "created-after": to_rfc3339(created_after), "count": count, "sort-by": sort_by, "sort-dir": sort_dir}
362
- iterator = self._iterable_from_request(url, params, prefetch=not deep)
369
+
370
+ if disable_prefetch is None:
371
+ disable_prefetch = deep
372
+
373
+ iterator = self._iterable_from_request(url, params, prefetch=not disable_prefetch)
363
374
  if typed is None:
364
375
  typed = self.typed
365
376
  if deep:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ballchasing
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: A Python wrapper around the Ballchasing API
5
5
  Author-email: Rolv-Arild Braaten <rolv_arild@hotmail.com>
6
6
  License: MIT License
@@ -1,5 +1,5 @@
1
1
  ballchasing/__init__.py,sha256=AS4JkwcGjNkO2ojK2nrBKTIjUnOqMFS_OLGDv52d4OA,2701
2
- ballchasing/api.py,sha256=GwCqrMGociSaTVaqnDCB_79Hq66RZRl_FB4RV1IS_58,23894
2
+ ballchasing/api.py,sha256=233H_-mZ1vBZANudhGErnfseVq8Ptd7Yng63dKfbtz4,24305
3
3
  ballchasing/constants.py,sha256=BEVGNljc5K1AxkaXc1nyXwhGZ8ceHDLmA8hReOBikVQ,12705
4
4
  ballchasing/stats_info.tsv,sha256=IBvVe0CF5HsTvNJFQlVCT4zeq-RfiKvgtro5a8KMTis,12258
5
5
  ballchasing/typed/__init__.py,sha256=oHkYhNK4m1tNwq_E72CYi-mUpoqo9w2kgEF17SdcRP4,279
@@ -13,12 +13,12 @@ ballchasing/util/dates.py,sha256=gUSldK6-jMNbGLaBiYwmiKUR0h0ulzPiiDCZdFbBq2s,883
13
13
  ballchasing/util/iterators.py,sha256=1An0MiQ6QZHLpa-38eDYek-OrOGLI5pI9m0h1YDKUdc,4196
14
14
  ballchasing/util/replays.py,sha256=TAk5RR8ghO8FcEdu1N2dh9WAZvQ9M_FRuufOJV3XW0E,8355
15
15
  ballchasing/util/stats.py,sha256=8Bi3TvbUmV97eVXY1moc8hjTUetKXZ8XAhSJFW_DC8s,2461
16
- python_ballchasing-0.5.0.dist-info/licenses/LICENSE,sha256=ua0R_J89EfdcyYXy_6TMz6BoSxABvyBYCfgfOKu12FE,1075
16
+ python_ballchasing-0.5.1.dist-info/licenses/LICENSE,sha256=ua0R_J89EfdcyYXy_6TMz6BoSxABvyBYCfgfOKu12FE,1075
17
17
  scripts/get_maps.py,sha256=y3X28uqoi4kRo8OMZH0c2JS0AGlNCl4ZLO4d7_ZVteA,6065
18
18
  scripts/make_types.py,sha256=6EBF5V0Lh7bt7LTKKBWJI8jywVObpDC20-GYOOdFqFU,6588
19
19
  scripts/test.py,sha256=j_qRBqFeymHtzh75z9JQxpwJSnAwsmljSsS8b2yyu9I,2748
20
20
  scripts/test_typed.py,sha256=3XYwQWVLqH2L_gr6FOfZ_elXYvSipzAhnmVUXYH1te4,3116
21
- python_ballchasing-0.5.0.dist-info/METADATA,sha256=S-0x9yrqTokcwwoCwOs73IYElwE2ABdipT51I65hURI,3687
22
- python_ballchasing-0.5.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
23
- python_ballchasing-0.5.0.dist-info/top_level.txt,sha256=pb478ijCotXjUeMz_Ki1wM6oGMWOG9ejH9m6LfoweJE,20
24
- python_ballchasing-0.5.0.dist-info/RECORD,,
21
+ python_ballchasing-0.5.1.dist-info/METADATA,sha256=qmPr5ASEXyMwEXoCJZlebgdw9gzu57YvDCrCoYWTnmA,3687
22
+ python_ballchasing-0.5.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
23
+ python_ballchasing-0.5.1.dist-info/top_level.txt,sha256=pb478ijCotXjUeMz_Ki1wM6oGMWOG9ejH9m6LfoweJE,20
24
+ python_ballchasing-0.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (84.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5