blitz-api-py 2.1.0__tar.gz → 2.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.
Files changed (52) hide show
  1. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/CHANGELOG.md +7 -0
  2. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/PKG-INFO +6 -4
  3. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/README.md +4 -2
  4. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_base_client.py +5 -3
  5. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_client_async.py +13 -2
  6. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_client_sync.py +13 -2
  7. blitz_api_py-2.2.0/src/blitz_api/_version.py +1 -0
  8. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/__init__.py +8 -0
  9. blitz_api_py-2.2.0/src/blitz_api/resources/_async/changelog.py +53 -0
  10. blitz_api_py-2.2.0/src/blitz_api/resources/_async/company.py +55 -0
  11. blitz_api_py-2.2.0/src/blitz_api/resources/_sync/changelog.py +55 -0
  12. blitz_api_py-2.2.0/src/blitz_api/resources/_sync/company.py +57 -0
  13. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/__init__.py +10 -0
  14. blitz_api_py-2.2.0/src/blitz_api/types/changelog.py +58 -0
  15. blitz_api_py-2.2.0/src/blitz_api/types/company.py +31 -0
  16. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/filters.py +23 -0
  17. blitz_api_py-2.1.0/src/blitz_api/_version.py +0 -1
  18. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/.gitignore +0 -0
  19. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/LICENSE +0 -0
  20. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/pyproject.toml +0 -0
  21. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/__init__.py +0 -0
  22. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_client.py +0 -0
  23. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_compat.py +0 -0
  24. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_constants.py +0 -0
  25. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_exceptions.py +0 -0
  26. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_pagination_async.py +0 -0
  27. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_pagination_base.py +0 -0
  28. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_pagination_sync.py +0 -0
  29. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_rate_limit.py +0 -0
  30. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_rate_limit_async.py +0 -0
  31. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/_rate_limit_sync.py +0 -0
  32. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/py.typed +0 -0
  33. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_async/__init__.py +0 -0
  34. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_async/account.py +0 -0
  35. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_async/enrichment.py +0 -0
  36. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_async/jobs.py +0 -0
  37. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_async/search.py +0 -0
  38. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_async/utils.py +0 -0
  39. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_sync/__init__.py +0 -0
  40. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_sync/account.py +0 -0
  41. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_sync/enrichment.py +0 -0
  42. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_sync/jobs.py +0 -0
  43. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_sync/search.py +0 -0
  44. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/resources/_sync/utils.py +0 -0
  45. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/_models.py +0 -0
  46. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/account.py +0 -0
  47. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/enrichment.py +0 -0
  48. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/enums.py +0 -0
  49. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/jobs.py +0 -0
  50. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/search.py +0 -0
  51. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/shared.py +0 -0
  52. {blitz_api_py-2.1.0 → blitz_api_py-2.2.0}/src/blitz_api/types/utils.py +0 -0
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0](https://github.com/api-blitz/blitz-api-py/compare/v2.1.0...v2.2.0) (2026-08-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * add company and changelog resources with new endpoints ([0dd4ae0](https://github.com/api-blitz/blitz-api-py/commit/0dd4ae0df510352c72143f00431e66b947409758))
9
+
3
10
  ## [2.1.0](https://github.com/api-blitz/blitz-api-py/compare/v2.0.0...v2.1.0) (2026-07-23)
4
11
 
5
12
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: blitz-api-py
3
- Version: 2.1.0
3
+ Version: 2.2.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
@@ -117,7 +117,7 @@ from blitz_api import AsyncBlitzAPI
117
117
  async def main() -> None:
118
118
  async with AsyncBlitzAPI() as client:
119
119
  result = await client.enrichment.company(
120
- company_linkedin_url="https://www.linkedin.com/company/openai",
120
+ company_linkedin_url="https://www.linkedin.com/company/placeholder-co",
121
121
  )
122
122
  print(result.company.name if result.company else None)
123
123
 
@@ -193,15 +193,17 @@ always call the API from your backend.
193
193
 
194
194
  ## Endpoints
195
195
 
196
- All methods are grouped into five namespaces:
196
+ All methods are grouped into seven namespaces:
197
197
 
198
198
  | Namespace | Methods |
199
199
  | --- | --- |
200
200
  | `client.account` | `key_info()` |
201
201
  | `client.search` | `people()`, `companies()`, `employee_finder()`, `waterfall_icp()` |
202
202
  | `client.jobs` | `search()`, `company()` |
203
+ | `client.company` | `tam_by_jobs()` |
203
204
  | `client.enrichment` | `email()`, `phone()`, `email_to_person()`, `phone_to_person()`, `company()`, `domain_to_linkedin()`, `linkedin_to_domain()`, `company_distribution_by_country()`, `company_distribution_by_department()` |
204
205
  | `client.utils` | `current_date()` |
206
+ | `client.changelog` | `list()` |
205
207
 
206
208
  Every method returns a typed Pydantic model (see `blitz_api.types`). Enum-backed
207
209
  filter fields (e.g. `Industry`, `JobLevel`, `Continent`) accept either an enum
@@ -86,7 +86,7 @@ from blitz_api import AsyncBlitzAPI
86
86
  async def main() -> None:
87
87
  async with AsyncBlitzAPI() as client:
88
88
  result = await client.enrichment.company(
89
- company_linkedin_url="https://www.linkedin.com/company/openai",
89
+ company_linkedin_url="https://www.linkedin.com/company/placeholder-co",
90
90
  )
91
91
  print(result.company.name if result.company else None)
92
92
 
@@ -162,15 +162,17 @@ always call the API from your backend.
162
162
 
163
163
  ## Endpoints
164
164
 
165
- All methods are grouped into five namespaces:
165
+ All methods are grouped into seven namespaces:
166
166
 
167
167
  | Namespace | Methods |
168
168
  | --- | --- |
169
169
  | `client.account` | `key_info()` |
170
170
  | `client.search` | `people()`, `companies()`, `employee_finder()`, `waterfall_icp()` |
171
171
  | `client.jobs` | `search()`, `company()` |
172
+ | `client.company` | `tam_by_jobs()` |
172
173
  | `client.enrichment` | `email()`, `phone()`, `email_to_person()`, `phone_to_person()`, `company()`, `domain_to_linkedin()`, `linkedin_to_domain()`, `company_distribution_by_country()`, `company_distribution_by_department()` |
173
174
  | `client.utils` | `current_date()` |
175
+ | `client.changelog` | `list()` |
174
176
 
175
177
  Every method returns a typed Pydantic model (see `blitz_api.types`). Enum-backed
176
178
  filter fields (e.g. `Industry`, `JobLevel`, `Continent`) accept either an enum
@@ -16,7 +16,7 @@ from typing import Any, TypeVar, cast
16
16
  from urllib.parse import urljoin
17
17
 
18
18
  import httpx
19
- from pydantic import ValidationError
19
+ from pydantic import BaseModel, ValidationError
20
20
 
21
21
  from . import _constants as C
22
22
  from ._exceptions import (
@@ -29,9 +29,11 @@ from ._exceptions import (
29
29
  RateLimitError,
30
30
  ServerError,
31
31
  )
32
- from .types._models import BlitzModel
33
32
 
34
- ResponseT = TypeVar("ResponseT", bound=BlitzModel)
33
+ # Bound to ``pydantic.BaseModel`` (not ``BlitzModel``) so the request pipeline can also
34
+ # validate a ``RootModel`` — used for ``changelog.list``'s top-level JSON array
35
+ # (``ChangelogResponse``), which is a ``BaseModel`` but not a ``BlitzModel``.
36
+ ResponseT = TypeVar("ResponseT", bound=BaseModel)
35
37
 
36
38
  # Status code -> exception class. Anything not listed that is still non-2xx
37
39
  # falls back to a generic APIStatusError (or ServerError for any 5xx).
@@ -16,6 +16,8 @@ from ._pagination_base import BasePage
16
16
  from ._rate_limit import AsyncRateLimiter
17
17
  from .resources import (
18
18
  AsyncAccountResource,
19
+ AsyncChangelogResource,
20
+ AsyncCompanyResource,
19
21
  AsyncEnrichmentResource,
20
22
  AsyncJobsResource,
21
23
  AsyncSearchResource,
@@ -86,6 +88,7 @@ class AsyncBlitzAPI(BaseClient):
86
88
  *,
87
89
  body: Any | None,
88
90
  cast_to: type[ResponseT],
91
+ params: dict[str, Any] | None = None,
89
92
  timeout: TimeoutParam = None,
90
93
  ) -> ResponseT:
91
94
  url = self._build_url(path)
@@ -98,11 +101,11 @@ class AsyncBlitzAPI(BaseClient):
98
101
  try:
99
102
  if timeout is None:
100
103
  response = await self._http_client.request(
101
- method, url, headers=headers, json=json_body
104
+ method, url, headers=headers, json=json_body, params=params
102
105
  )
103
106
  else:
104
107
  response = await self._http_client.request(
105
- method, url, headers=headers, json=json_body, timeout=timeout
108
+ method, url, headers=headers, json=json_body, params=params, timeout=timeout
106
109
  )
107
110
  except httpx.TimeoutException as exc:
108
111
  if self._should_retry_exception(exc) and attempt < self.max_retries:
@@ -160,6 +163,10 @@ class AsyncBlitzAPI(BaseClient):
160
163
  def jobs(self) -> AsyncJobsResource:
161
164
  return AsyncJobsResource(self)
162
165
 
166
+ @cached_property
167
+ def company(self) -> AsyncCompanyResource:
168
+ return AsyncCompanyResource(self)
169
+
163
170
  @cached_property
164
171
  def enrichment(self) -> AsyncEnrichmentResource:
165
172
  return AsyncEnrichmentResource(self)
@@ -167,3 +174,7 @@ class AsyncBlitzAPI(BaseClient):
167
174
  @cached_property
168
175
  def utils(self) -> AsyncUtilsResource:
169
176
  return AsyncUtilsResource(self)
177
+
178
+ @cached_property
179
+ def changelog(self) -> AsyncChangelogResource:
180
+ return AsyncChangelogResource(self)
@@ -18,6 +18,8 @@ from ._pagination_base import BasePage
18
18
  from ._rate_limit import RateLimiter
19
19
  from .resources import (
20
20
  AccountResource,
21
+ ChangelogResource,
22
+ CompanyResource,
21
23
  EnrichmentResource,
22
24
  JobsResource,
23
25
  SearchResource,
@@ -88,6 +90,7 @@ class BlitzAPI(BaseClient):
88
90
  *,
89
91
  body: Any | None,
90
92
  cast_to: type[ResponseT],
93
+ params: dict[str, Any] | None = None,
91
94
  timeout: TimeoutParam = None,
92
95
  ) -> ResponseT:
93
96
  url = self._build_url(path)
@@ -100,11 +103,11 @@ class BlitzAPI(BaseClient):
100
103
  try:
101
104
  if timeout is None:
102
105
  response = self._http_client.request(
103
- method, url, headers=headers, json=json_body
106
+ method, url, headers=headers, json=json_body, params=params
104
107
  )
105
108
  else:
106
109
  response = self._http_client.request(
107
- method, url, headers=headers, json=json_body, timeout=timeout
110
+ method, url, headers=headers, json=json_body, params=params, timeout=timeout
108
111
  )
109
112
  except httpx.TimeoutException as exc:
110
113
  if self._should_retry_exception(exc) and attempt < self.max_retries:
@@ -162,6 +165,10 @@ class BlitzAPI(BaseClient):
162
165
  def jobs(self) -> JobsResource:
163
166
  return JobsResource(self)
164
167
 
168
+ @cached_property
169
+ def company(self) -> CompanyResource:
170
+ return CompanyResource(self)
171
+
165
172
  @cached_property
166
173
  def enrichment(self) -> EnrichmentResource:
167
174
  return EnrichmentResource(self)
@@ -169,3 +176,7 @@ class BlitzAPI(BaseClient):
169
176
  @cached_property
170
177
  def utils(self) -> UtilsResource:
171
178
  return UtilsResource(self)
179
+
180
+ @cached_property
181
+ def changelog(self) -> ChangelogResource:
182
+ return ChangelogResource(self)
@@ -0,0 +1 @@
1
+ __version__ = "2.2.0" # x-release-please-version
@@ -7,11 +7,15 @@ The ``Async*`` classes are hand-written in ``resources/_async``; the sync classe
7
7
  from __future__ import annotations
8
8
 
9
9
  from ._async.account import AsyncAccountResource
10
+ from ._async.changelog import AsyncChangelogResource
11
+ from ._async.company import AsyncCompanyResource
10
12
  from ._async.enrichment import AsyncEnrichmentResource
11
13
  from ._async.jobs import AsyncJobsResource
12
14
  from ._async.search import AsyncSearchResource
13
15
  from ._async.utils import AsyncUtilsResource
14
16
  from ._sync.account import AccountResource
17
+ from ._sync.changelog import ChangelogResource
18
+ from ._sync.company import CompanyResource
15
19
  from ._sync.enrichment import EnrichmentResource
16
20
  from ._sync.jobs import JobsResource
17
21
  from ._sync.search import SearchResource
@@ -24,8 +28,12 @@ __all__ = [
24
28
  "AsyncSearchResource",
25
29
  "JobsResource",
26
30
  "AsyncJobsResource",
31
+ "CompanyResource",
32
+ "AsyncCompanyResource",
27
33
  "EnrichmentResource",
28
34
  "AsyncEnrichmentResource",
29
35
  "UtilsResource",
30
36
  "AsyncUtilsResource",
37
+ "ChangelogResource",
38
+ "AsyncChangelogResource",
31
39
  ]
@@ -0,0 +1,53 @@
1
+ """The Changelog resource: ``client.changelog``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, Any
6
+
7
+ from ..._compat import TimeoutParam
8
+ from ...types.changelog import ChangelogEntry, ChangelogResponse
9
+
10
+ if TYPE_CHECKING:
11
+ from ..._client import AsyncBlitzAPI
12
+
13
+ # Public endpoint: NO ``/v2`` prefix, and the trailing slash is load-bearing.
14
+ _CHANGELOG = "/changelog/"
15
+
16
+
17
+ def _drop_none(**kwargs: Any) -> dict[str, Any]:
18
+ """Build a query-param mapping keeping only the arguments the caller provided."""
19
+ return {key: value for key, value in kwargs.items() if value is not None}
20
+
21
+
22
+ class AsyncChangelogResource:
23
+ def __init__(self, client: AsyncBlitzAPI) -> None:
24
+ self._client = client
25
+
26
+ async def list(
27
+ self,
28
+ *,
29
+ days: int | None = None,
30
+ limit: int | None = None,
31
+ timeout: TimeoutParam = None,
32
+ ) -> list[ChangelogEntry]:
33
+ """List the public Blitz API changelog, newest-first.
34
+
35
+ Each entry carries a ``date``, a ``type`` (``breaking`` | ``feature`` |
36
+ ``improvement`` | ``fix`` | ``deprecation`` | ``announcement``), a ``title``, and
37
+ optional ``body``, ``affected_endpoints``, and ``links``.
38
+
39
+ This endpoint is **public** — it costs no credits and works regardless of API-key
40
+ validity (the SDK still sends the key header, which the endpoint ignores). It is
41
+ **not paginated**: it returns a plain list filtered by the ``days`` / ``limit``
42
+ query parameters.
43
+ """
44
+ params = _drop_none(days=days, limit=limit)
45
+ result = await self._client._request(
46
+ "GET",
47
+ _CHANGELOG,
48
+ body=None,
49
+ cast_to=ChangelogResponse,
50
+ params=params,
51
+ timeout=timeout,
52
+ )
53
+ return result.root
@@ -0,0 +1,55 @@
1
+ """The Company resource: ``client.company``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, Any
6
+
7
+ from ..._compat import TimeoutParam
8
+ from ..._pagination_async import AsyncCursorPage
9
+ from ...types.company import TamByJobsMatch
10
+ from ...types.filters import JobCompanyFilter, TamJobFilter
11
+
12
+ if TYPE_CHECKING:
13
+ from ..._client import AsyncBlitzAPI
14
+
15
+ _TAM_BY_JOBS = "/v2/company/tam-by-jobs"
16
+
17
+
18
+ def _drop_none(**kwargs: Any) -> dict[str, Any]:
19
+ """Build a request body keeping only the arguments the caller provided."""
20
+ return {key: value for key, value in kwargs.items() if value is not None}
21
+
22
+
23
+ class AsyncCompanyResource:
24
+ def __init__(self, client: AsyncBlitzAPI) -> None:
25
+ self._client = client
26
+
27
+ async def tam_by_jobs(
28
+ self,
29
+ *,
30
+ job: TamJobFilter | None = None,
31
+ company: JobCompanyFilter | None = None,
32
+ max_results: int | None = None,
33
+ cursor: str | None = None,
34
+ timeout: TimeoutParam = None,
35
+ ) -> AsyncCursorPage[TamByJobsMatch]:
36
+ """Build a Total Addressable Market of companies from live hiring signals.
37
+
38
+ Combine job-level filters (title, description, seniority, ...) with company
39
+ firmographics, and get back each matching company plus how many of its current
40
+ postings matched (``matched_jobs``). Use ``job["min_per_company"]`` to require a
41
+ minimum number of matching postings per company.
42
+
43
+ Cursor-paginated: auto-paginates over every ``{company, matched_jobs}`` match when
44
+ the result is iterated; use ``.iter_pages()`` or the ``cursor=`` arg for manual
45
+ control. The API bills **1 credit per result returned**; bound spend with
46
+ ``max_items`` on ``.collect()`` / ``.auto_paging_iter()``.
47
+ """
48
+ body = _drop_none(job=job, company=company, max_results=max_results, cursor=cursor)
49
+ return await self._client._request(
50
+ "POST",
51
+ _TAM_BY_JOBS,
52
+ body=body,
53
+ cast_to=AsyncCursorPage[TamByJobsMatch],
54
+ timeout=timeout,
55
+ )
@@ -0,0 +1,55 @@
1
+ # This file is @generated by scripts/gen_sync.py from src/blitz_api/resources/_async/changelog.py.
2
+ # Do not edit by hand — edit the async source and run `python scripts/gen_sync.py`.
3
+ """The Changelog resource: ``client.changelog``."""
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import TYPE_CHECKING, Any
8
+
9
+ from ..._compat import TimeoutParam
10
+ from ...types.changelog import ChangelogEntry, ChangelogResponse
11
+
12
+ if TYPE_CHECKING:
13
+ from ..._client import BlitzAPI
14
+
15
+ # Public endpoint: NO ``/v2`` prefix, and the trailing slash is load-bearing.
16
+ _CHANGELOG = "/changelog/"
17
+
18
+
19
+ def _drop_none(**kwargs: Any) -> dict[str, Any]:
20
+ """Build a query-param mapping keeping only the arguments the caller provided."""
21
+ return {key: value for key, value in kwargs.items() if value is not None}
22
+
23
+
24
+ class ChangelogResource:
25
+ def __init__(self, client: BlitzAPI) -> None:
26
+ self._client = client
27
+
28
+ def list(
29
+ self,
30
+ *,
31
+ days: int | None = None,
32
+ limit: int | None = None,
33
+ timeout: TimeoutParam = None,
34
+ ) -> list[ChangelogEntry]:
35
+ """List the public Blitz API changelog, newest-first.
36
+
37
+ Each entry carries a ``date``, a ``type`` (``breaking`` | ``feature`` |
38
+ ``improvement`` | ``fix`` | ``deprecation`` | ``announcement``), a ``title``, and
39
+ optional ``body``, ``affected_endpoints``, and ``links``.
40
+
41
+ This endpoint is **public** — it costs no credits and works regardless of API-key
42
+ validity (the SDK still sends the key header, which the endpoint ignores). It is
43
+ **not paginated**: it returns a plain list filtered by the ``days`` / ``limit``
44
+ query parameters.
45
+ """
46
+ params = _drop_none(days=days, limit=limit)
47
+ result = self._client._request(
48
+ "GET",
49
+ _CHANGELOG,
50
+ body=None,
51
+ cast_to=ChangelogResponse,
52
+ params=params,
53
+ timeout=timeout,
54
+ )
55
+ return result.root
@@ -0,0 +1,57 @@
1
+ # This file is @generated by scripts/gen_sync.py from src/blitz_api/resources/_async/company.py.
2
+ # Do not edit by hand — edit the async source and run `python scripts/gen_sync.py`.
3
+ """The Company resource: ``client.company``."""
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import TYPE_CHECKING, Any
8
+
9
+ from ..._compat import TimeoutParam
10
+ from ..._pagination_sync import CursorPage
11
+ from ...types.company import TamByJobsMatch
12
+ from ...types.filters import JobCompanyFilter, TamJobFilter
13
+
14
+ if TYPE_CHECKING:
15
+ from ..._client import BlitzAPI
16
+
17
+ _TAM_BY_JOBS = "/v2/company/tam-by-jobs"
18
+
19
+
20
+ def _drop_none(**kwargs: Any) -> dict[str, Any]:
21
+ """Build a request body keeping only the arguments the caller provided."""
22
+ return {key: value for key, value in kwargs.items() if value is not None}
23
+
24
+
25
+ class CompanyResource:
26
+ def __init__(self, client: BlitzAPI) -> None:
27
+ self._client = client
28
+
29
+ def tam_by_jobs(
30
+ self,
31
+ *,
32
+ job: TamJobFilter | None = None,
33
+ company: JobCompanyFilter | None = None,
34
+ max_results: int | None = None,
35
+ cursor: str | None = None,
36
+ timeout: TimeoutParam = None,
37
+ ) -> CursorPage[TamByJobsMatch]:
38
+ """Build a Total Addressable Market of companies from live hiring signals.
39
+
40
+ Combine job-level filters (title, description, seniority, ...) with company
41
+ firmographics, and get back each matching company plus how many of its current
42
+ postings matched (``matched_jobs``). Use ``job["min_per_company"]`` to require a
43
+ minimum number of matching postings per company.
44
+
45
+ Cursor-paginated: auto-paginates over every ``{company, matched_jobs}`` match when
46
+ the result is iterated; use ``.iter_pages()`` or the ``cursor=`` arg for manual
47
+ control. The API bills **1 credit per result returned**; bound spend with
48
+ ``max_items`` on ``.collect()`` / ``.auto_paging_iter()``.
49
+ """
50
+ body = _drop_none(job=job, company=company, max_results=max_results, cursor=cursor)
51
+ return self._client._request(
52
+ "POST",
53
+ _TAM_BY_JOBS,
54
+ body=body,
55
+ cast_to=CursorPage[TamByJobsMatch],
56
+ timeout=timeout,
57
+ )
@@ -8,6 +8,8 @@ Import response models and request filters from here, e.g.::
8
8
  from __future__ import annotations
9
9
 
10
10
  from .account import ActivePlan, KeyInfo
11
+ from .changelog import ChangelogEntry, ChangelogLink, ChangelogResponse
12
+ from .company import TamByJobsMatch
11
13
  from .enrichment import (
12
14
  CompanyDistributionByCountryItem,
13
15
  CompanyDistributionByCountryResponse,
@@ -56,6 +58,7 @@ from .filters import (
56
58
  PeopleLocationFilter,
57
59
  RangeFilter,
58
60
  SeniorityFilter,
61
+ TamJobFilter,
59
62
  WorkArrangementFilter,
60
63
  )
61
64
  from .jobs import Job
@@ -118,6 +121,7 @@ __all__ = [
118
121
  "CompanySizeFilter",
119
122
  "JobCompanyHQFilter",
120
123
  "JobCompanyFilter",
124
+ "TamJobFilter",
121
125
  # account
122
126
  "KeyInfo",
123
127
  "ActivePlan",
@@ -126,6 +130,12 @@ __all__ = [
126
130
  "WaterfallIcpResponse",
127
131
  # jobs (paginated results return the page classes exported from `blitz_api`)
128
132
  "Job",
133
+ # company (paginated results return the page classes exported from `blitz_api`)
134
+ "TamByJobsMatch",
135
+ # changelog
136
+ "ChangelogLink",
137
+ "ChangelogEntry",
138
+ "ChangelogResponse",
129
139
  # enrichment
130
140
  "EmailMatch",
131
141
  "EmailEnrichmentResponse",
@@ -0,0 +1,58 @@
1
+ """Response models for the Changelog resource.
2
+
3
+ ``changelog.list`` returns a **top-level JSON array** of entries, so the payload is
4
+ modelled as a pydantic ``RootModel`` (:data:`ChangelogResponse`) that the request
5
+ pipeline can validate; the resource method unwraps it to a plain
6
+ ``list[ChangelogEntry]`` (``.root``).
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from typing import Any
12
+
13
+ from pydantic import RootModel, field_validator
14
+
15
+ from ._models import BlitzModel
16
+
17
+ __all__ = [
18
+ "ChangelogLink",
19
+ "ChangelogEntry",
20
+ "ChangelogResponse",
21
+ ]
22
+
23
+
24
+ class ChangelogLink(BlitzModel):
25
+ """A labelled external link attached to a changelog entry (docs, migration guide, ...)."""
26
+
27
+ label: str | None = None
28
+ url: str | None = None
29
+
30
+
31
+ class ChangelogEntry(BlitzModel):
32
+ """A single public changelog entry, newest-first in the list.
33
+
34
+ ``type`` is the impact category — one of ``breaking``, ``feature``, ``improvement``,
35
+ ``fix``, ``deprecation``, ``announcement`` — kept a **loose ``str``** (not an enum)
36
+ so a new upstream category never breaks deserialization, the same forward-compatible
37
+ posture as ``Company.type`` / ``Company.industry``. ``affected_endpoints`` and
38
+ ``links`` are omitted for product announcements.
39
+ """
40
+
41
+ date: str | None = None
42
+ type: str | None = None
43
+ title: str | None = None
44
+ body: str | None = None
45
+ affected_endpoints: list[str] = []
46
+ links: list[ChangelogLink] = []
47
+
48
+ @field_validator("affected_endpoints", "links", mode="before")
49
+ @classmethod
50
+ def _null_list_to_empty(cls, value: Any) -> Any:
51
+ # The API returns ``null`` (not ``[]``) for an empty list; coerce to ``[]``
52
+ # so these fields are always iterable — matching the TS SDK's `blitzList`.
53
+ return [] if value is None else value
54
+
55
+
56
+ #: The ``changelog.list`` payload: a top-level array of entries. ``changelog.list``
57
+ #: unwraps this ``RootModel`` to the plain ``list[ChangelogEntry]`` it returns (``.root``).
58
+ ChangelogResponse = RootModel[list[ChangelogEntry]]
@@ -0,0 +1,31 @@
1
+ """Response models for the Company resource (TAM builders).
2
+
3
+ ``company.tam_by_jobs`` returns ``CursorPage[TamByJobsMatch]`` (the auto-paging cursor
4
+ page defined in :mod:`blitz_api._pagination_async` / ``_pagination_sync``), so there is
5
+ no per-endpoint response wrapper here — only the ``TamByJobsMatch`` item model.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from ._models import BlitzModel
11
+ from .shared import Company
12
+
13
+ __all__ = [
14
+ "TamByJobsMatch",
15
+ ]
16
+
17
+
18
+ class TamByJobsMatch(BlitzModel):
19
+ """One ``company.tam_by_jobs`` match: a company plus how many of its live job
20
+ postings matched the filters.
21
+
22
+ ``matched_jobs`` is the count on this company (it respects the request's
23
+ ``job.min_per_company`` floor). ``company`` reuses the shared
24
+ :class:`~blitz_api.types.shared.Company` model.
25
+
26
+ Unlike the search/jobs cursor pages, the TAM cursor page carries **no**
27
+ ``total_results`` (the spec omits it); iterate until ``cursor`` is ``None``.
28
+ """
29
+
30
+ company: Company | None = None
31
+ matched_jobs: int | None = None
@@ -209,6 +209,29 @@ class JobFilter(TypedDict, total=False):
209
209
  date_posted: DatePostedFilter
210
210
 
211
211
 
212
+ class TamJobFilter(TypedDict, total=False):
213
+ """Job criteria for ``company.tam_by_jobs`` — the same fields as ``JobFilter`` plus a
214
+ per-company floor.
215
+
216
+ Defined as a standalone ``TypedDict`` (this SDK's flat-``TypedDict`` convention, no
217
+ inheritance) so the shared ``JobFilter`` used by ``jobs.search`` / ``jobs.company`` —
218
+ which have no such field — never gains ``min_per_company``.
219
+ """
220
+
221
+ title: KeywordFilter
222
+ description: KeywordFilter
223
+ ai_keywords: KeywordFilter # Broad theme search across title, description, taxonomies.
224
+ field: KeywordFilter # Professional field or discipline. Free-form — any label.
225
+ seniority: SeniorityFilter
226
+ employment_type: EmploymentTypeFilter
227
+ work_arrangement: WorkArrangementFilter
228
+ location: JobLocationFilter
229
+ date_posted: DatePostedFilter
230
+ # Only include companies with at least this many matching job postings (integer,
231
+ # 0-25; ``0`` = unset). Raises the bar for what counts as a hit when building a TAM.
232
+ min_per_company: int
233
+
234
+
212
235
  class CompanySizeFilter(TypedDict, total=False):
213
236
  """Include-only filter over the LinkedIn size buckets. The API exposes no ``exclude``."""
214
237
 
@@ -1 +0,0 @@
1
- __version__ = "2.1.0" # x-release-please-version
File without changes
File without changes