blitz-api-py 0.1.0__tar.gz → 0.3.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.
Files changed (44) hide show
  1. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/.gitignore +5 -0
  2. blitz_api_py-0.3.0/CHANGELOG.md +31 -0
  3. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/PKG-INFO +1 -1
  4. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_pagination_async.py +21 -0
  5. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_pagination_sync.py +21 -0
  6. blitz_api_py-0.3.0/src/blitz_api/_version.py +1 -0
  7. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/search.py +3 -0
  8. blitz_api_py-0.1.0/CHANGELOG.md +0 -17
  9. blitz_api_py-0.1.0/src/blitz_api/_version.py +0 -1
  10. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/LICENSE +0 -0
  11. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/README.md +0 -0
  12. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/pyproject.toml +0 -0
  13. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/__init__.py +0 -0
  14. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_base_client.py +0 -0
  15. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_client.py +0 -0
  16. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_client_async.py +0 -0
  17. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_client_sync.py +0 -0
  18. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_compat.py +0 -0
  19. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_constants.py +0 -0
  20. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_exceptions.py +0 -0
  21. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_pagination_base.py +0 -0
  22. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_rate_limit.py +0 -0
  23. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_rate_limit_async.py +0 -0
  24. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/_rate_limit_sync.py +0 -0
  25. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/py.typed +0 -0
  26. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/__init__.py +0 -0
  27. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_async/__init__.py +0 -0
  28. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_async/account.py +0 -0
  29. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_async/enrichment.py +0 -0
  30. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_async/search.py +0 -0
  31. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_async/utils.py +0 -0
  32. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_sync/__init__.py +0 -0
  33. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_sync/account.py +0 -0
  34. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_sync/enrichment.py +0 -0
  35. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_sync/search.py +0 -0
  36. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/resources/_sync/utils.py +0 -0
  37. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/__init__.py +0 -0
  38. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/_models.py +0 -0
  39. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/account.py +0 -0
  40. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/enrichment.py +0 -0
  41. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/enums.py +0 -0
  42. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/filters.py +0 -0
  43. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/shared.py +0 -0
  44. {blitz_api_py-0.1.0 → blitz_api_py-0.3.0}/src/blitz_api/types/utils.py +0 -0
@@ -25,6 +25,11 @@ coverage.xml
25
25
  # uv
26
26
  # (uv.lock IS committed; only ignore caches)
27
27
 
28
+ # Environment variables
29
+ .env
30
+ .env.*
31
+ !.env.example
32
+
28
33
  # Editors / OS
29
34
  .idea/
30
35
  .vscode/
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ ## [0.3.0](https://github.com/api-blitz/blitz-api-py/compare/v0.2.0...v0.3.0) (2026-06-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * generate enums from the live OpenAPI spec with offline drift guard ([#9](https://github.com/api-blitz/blitz-api-py/issues/9)) ([fee865c](https://github.com/api-blitz/blitz-api-py/commit/fee865c4d8f7c685330794fa79921dccd7556e37))
9
+
10
+ ## [0.2.0](https://github.com/api-blitz/blitz-api-py/compare/v0.1.0...v0.2.0) (2026-06-02)
11
+
12
+
13
+ ### Features
14
+
15
+ * cursor guard, page.collect(), and typed waterfall-icp fields ([#7](https://github.com/api-blitz/blitz-api-py/issues/7)) ([b77cdff](https://github.com/api-blitz/blitz-api-py/commit/b77cdffc99c680c2a37d36c8d22ee4c5381e8c68))
16
+
17
+ ## [0.1.0](https://github.com/api-blitz/blitz-api-py/compare/v0.1.0...v0.1.0) (2026-06-02)
18
+
19
+
20
+ ### Features
21
+
22
+ * typed Python SDK for the Blitz API with automated releases ([5641a51](https://github.com/api-blitz/blitz-api-py/commit/5641a51b405108029bc701988e08d6210a1255f6))
23
+
24
+ ## Changelog
25
+
26
+ All notable changes to this project are documented in this file.
27
+
28
+ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
29
+ and the changelog is maintained automatically by
30
+ [release-please](https://github.com/googleapis/release-please) from
31
+ [Conventional Commits](https://www.conventionalcommits.org/).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blitz-api-py
3
- Version: 0.1.0
3
+ Version: 0.3.0
4
4
  Summary: Typed Python SDK for the Blitz API — B2B data, search, and enrichment.
5
5
  Project-URL: Homepage, https://blitz-api.ai
6
6
  Project-URL: Documentation, https://docs.blitz-api.ai
@@ -17,6 +17,7 @@ from typing import Any, Generic, TypeVar, cast
17
17
 
18
18
  from typing_extensions import Self
19
19
 
20
+ from ._exceptions import BlitzError
20
21
  from ._pagination_base import BasePage
21
22
 
22
23
  ItemT = TypeVar("ItemT")
@@ -49,6 +50,17 @@ class AsyncPaginator(BasePage, Generic[ItemT]):
49
50
  """Iterate every item across all pages, optionally stopping after ``max_items``."""
50
51
  return self._auto_paging_items(max_items)
51
52
 
53
+ async def collect(self, *, max_items: int | None = None) -> list[ItemT]:
54
+ """Drain every item across all pages into a list, optionally capped at ``max_items``.
55
+
56
+ Convenience over a manual iteration loop; pair with ``max_items`` so an unbounded result
57
+ set can't exhaust memory — or credits, since the API bills per result returned.
58
+ """
59
+ items: list[ItemT] = []
60
+ async for item in self._auto_paging_items(max_items):
61
+ items.append(item)
62
+ return items
63
+
52
64
  async def iter_pages(self, *, max_pages: int | None = None) -> AsyncIterator[Self]:
53
65
  """Iterate page objects across the result set, optionally capped at ``max_pages``."""
54
66
  page = self
@@ -97,6 +109,15 @@ class AsyncCursorPage(AsyncPaginator[ItemT], Generic[ItemT]):
97
109
  return bool(self.cursor)
98
110
 
99
111
  def _next_body(self) -> dict[str, Any]:
112
+ # Guard against a non-advancing cursor: if the API hands back the same cursor it was
113
+ # given, paging again would re-fetch (and re-bill) the same page forever. ``_body``
114
+ # holds the cursor that fetched THIS page (bound after the request), so a cheap equality
115
+ # check breaks the loop instead of spinning. Mirrors the JS SDK's CursorPage guard.
116
+ if self.cursor is not None and self.cursor == self._body.get("cursor"):
117
+ raise BlitzError(
118
+ "Cursor did not advance: the API returned the same cursor it was given. "
119
+ "Aborting to avoid an infinite pagination loop."
120
+ )
100
121
  return {**self._body, "cursor": self.cursor}
101
122
 
102
123
 
@@ -19,6 +19,7 @@ from typing import Any, Generic, TypeVar, cast
19
19
 
20
20
  from typing_extensions import Self
21
21
 
22
+ from ._exceptions import BlitzError
22
23
  from ._pagination_base import BasePage
23
24
 
24
25
  ItemT = TypeVar("ItemT")
@@ -51,6 +52,17 @@ class Paginator(BasePage, Generic[ItemT]):
51
52
  """Iterate every item across all pages, optionally stopping after ``max_items``."""
52
53
  return self._auto_paging_items(max_items)
53
54
 
55
+ def collect(self, *, max_items: int | None = None) -> list[ItemT]:
56
+ """Drain every item across all pages into a list, optionally capped at ``max_items``.
57
+
58
+ Convenience over a manual iteration loop; pair with ``max_items`` so an unbounded result
59
+ set can't exhaust memory — or credits, since the API bills per result returned.
60
+ """
61
+ items: list[ItemT] = []
62
+ for item in self._auto_paging_items(max_items):
63
+ items.append(item)
64
+ return items
65
+
54
66
  def iter_pages(self, *, max_pages: int | None = None) -> Iterator[Self]:
55
67
  """Iterate page objects across the result set, optionally capped at ``max_pages``."""
56
68
  page = self
@@ -99,6 +111,15 @@ class CursorPage(Paginator[ItemT], Generic[ItemT]):
99
111
  return bool(self.cursor)
100
112
 
101
113
  def _next_body(self) -> dict[str, Any]:
114
+ # Guard against a non-advancing cursor: if the API hands back the same cursor it was
115
+ # given, paging again would re-fetch (and re-bill) the same page forever. ``_body``
116
+ # holds the cursor that fetched THIS page (bound after the request), so a cheap equality
117
+ # check breaks the loop instead of spinning. Mirrors the JS SDK's CursorPage guard.
118
+ if self.cursor is not None and self.cursor == self._body.get("cursor"):
119
+ raise BlitzError(
120
+ "Cursor did not advance: the API returned the same cursor it was given. "
121
+ "Aborting to avoid an infinite pagination loop."
122
+ )
102
123
  return {**self._body, "cursor": self.cursor}
103
124
 
104
125
 
@@ -0,0 +1 @@
1
+ __version__ = "0.3.0" # x-release-please-version
@@ -33,4 +33,7 @@ class WaterfallIcpMatch(BlitzModel):
33
33
  class WaterfallIcpResponse(BlitzModel):
34
34
  """Result of ``search.waterfall_icp``."""
35
35
 
36
+ company_linkedin_url: str | None = None
37
+ max_results: int | None = None
38
+ results_length: int | None = None
36
39
  results: list[WaterfallIcpMatch] = []
@@ -1,17 +0,0 @@
1
- # Changelog
2
-
3
- ## [0.1.0](https://github.com/api-blitz/blitz-api-py/compare/v0.1.0...v0.1.0) (2026-06-02)
4
-
5
-
6
- ### Features
7
-
8
- * typed Python SDK for the Blitz API with automated releases ([5641a51](https://github.com/api-blitz/blitz-api-py/commit/5641a51b405108029bc701988e08d6210a1255f6))
9
-
10
- ## Changelog
11
-
12
- All notable changes to this project are documented in this file.
13
-
14
- This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
15
- and the changelog is maintained automatically by
16
- [release-please](https://github.com/googleapis/release-please) from
17
- [Conventional Commits](https://www.conventionalcommits.org/).
@@ -1 +0,0 @@
1
- __version__ = "0.1.0" # x-release-please-version
File without changes
File without changes