python-ballchasing 0.5.0__tar.gz → 0.5.1__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 (29) hide show
  1. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/PKG-INFO +1 -1
  2. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/api.py +13 -2
  3. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/pyproject.toml +1 -1
  4. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/python_ballchasing.egg-info/PKG-INFO +1 -1
  5. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/LICENSE +0 -0
  6. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/README.md +0 -0
  7. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/__init__.py +0 -0
  8. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/constants.py +0 -0
  9. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/stats_info.tsv +0 -0
  10. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/typed/__init__.py +0 -0
  11. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/typed/deep_group.py +0 -0
  12. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/typed/deep_replay.py +0 -0
  13. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/typed/shallow_group.py +0 -0
  14. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/typed/shallow_replay.py +0 -0
  15. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/typed/shared.py +0 -0
  16. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/util/__init__.py +0 -0
  17. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/util/dates.py +0 -0
  18. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/util/iterators.py +0 -0
  19. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/util/replays.py +0 -0
  20. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/ballchasing/util/stats.py +0 -0
  21. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/python_ballchasing.egg-info/SOURCES.txt +0 -0
  22. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/python_ballchasing.egg-info/dependency_links.txt +0 -0
  23. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/python_ballchasing.egg-info/requires.txt +0 -0
  24. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/python_ballchasing.egg-info/top_level.txt +0 -0
  25. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/scripts/get_maps.py +0 -0
  26. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/scripts/make_types.py +0 -0
  27. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/scripts/test.py +0 -0
  28. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/scripts/test_typed.py +0 -0
  29. {python_ballchasing-0.5.0 → python_ballchasing-0.5.1}/setup.cfg +0 -0
@@ -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
@@ -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:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-ballchasing"
7
- version = "0.5.0"
7
+ version = "0.5.1"
8
8
  authors = [
9
9
  { name = "Rolv-Arild Braaten", email = "rolv_arild@hotmail.com" },
10
10
  ]
@@ -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