Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.11.0"
".": "0.12.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-18bb184b75673248917773c4c074813ca4bd966458b2f039b937df63209c029d.yml
openapi_spec_hash: ef79dd2063dd500127748ee843f5e783
config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-a831ece9950c336fba69327e01aed391a08418e1898f4aff27a800471f139cc7.yml
openapi_spec_hash: 459258410b739536cdc75b91e8b4eac7
config_hash: 70354330f92ce169beabc98696ebb9a3
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.12.0 (2026-04-25)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.11.0...v0.12.0)

### Features

* **api:** manual updates ([985bdda](https://github.com/context-dot-dev/context-python-sdk/commit/985bdda494fb493203a3b1db746c5c00c63199d1))

## 0.11.0 (2026-04-24)

Full Changelog: [v0.10.0...v0.11.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.10.0...v0.11.0)
Expand Down
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ Methods:
Types:

```python
from context.dev.types import IndustryRetrieveNaicsResponse
from context.dev.types import IndustryRetrieveNaicsResponse, IndustryRetrieveSicResponse
```

Methods:

- <code title="get /web/naics">client.industry.<a href="./src/context/dev/resources/industry.py">retrieve_naics</a>(\*\*<a href="src/context/dev/types/industry_retrieve_naics_params.py">params</a>) -> <a href="./src/context/dev/types/industry_retrieve_naics_response.py">IndustryRetrieveNaicsResponse</a></code>
- <code title="get /web/sic">client.industry.<a href="./src/context/dev/resources/industry.py">retrieve_sic</a>(\*\*<a href="src/context/dev/types/industry_retrieve_sic_params.py">params</a>) -> <a href="./src/context/dev/types/industry_retrieve_sic_response.py">IndustryRetrieveSicResponse</a></code>

# Utility

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "context.dev"
version = "0.11.0"
version = "0.12.0"
description = "The official Python library for the context.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/context/dev/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "context.dev"
__version__ = "0.11.0" # x-release-please-version
__version__ = "0.12.0" # x-release-please-version
149 changes: 148 additions & 1 deletion src/context/dev/resources/industry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

from __future__ import annotations

from typing_extensions import Literal

import httpx

from ..types import industry_retrieve_naics_params
from ..types import industry_retrieve_sic_params, industry_retrieve_naics_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
Expand All @@ -16,6 +18,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.industry_retrieve_sic_response import IndustryRetrieveSicResponse
from ..types.industry_retrieve_naics_response import IndustryRetrieveNaicsResponse

__all__ = ["IndustryResource", "AsyncIndustryResource"]
Expand Down Expand Up @@ -100,6 +103,72 @@ def retrieve_naics(
cast_to=IndustryRetrieveNaicsResponse,
)

def retrieve_sic(
self,
*,
input: str,
max_results: int | Omit = omit,
min_results: int | Omit = omit,
timeout_ms: int | Omit = omit,
type: Literal["original_sic", "latest_sec"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> IndustryRetrieveSicResponse:
"""
Classify any brand into Standard Industrial Classification (SIC) codes from its
domain or name. Choose between the original 1987 SIC system (`original_sic`) or
the latest SIC list maintained by the SEC (`latest_sec`).

Args:
input: Brand domain or title to retrieve SIC code for. If a valid domain is provided,
it will be used for classification, otherwise, we will search for the brand
using the provided title.

max_results: Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.

min_results: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.

timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
than this value, it will be aborted with a 408 status code. Maximum allowed
value is 300000ms (5 minutes).

type: Which SIC dataset to classify against. `original_sic` uses the 1987 Standard
Industrial Classification system; `latest_sec` uses the current SIC list as
published by the SEC. Defaults to `original_sic`.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/web/sic",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"input": input,
"max_results": max_results,
"min_results": min_results,
"timeout_ms": timeout_ms,
"type": type,
},
industry_retrieve_sic_params.IndustryRetrieveSicParams,
),
),
cast_to=IndustryRetrieveSicResponse,
)


class AsyncIndustryResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -180,6 +249,72 @@ async def retrieve_naics(
cast_to=IndustryRetrieveNaicsResponse,
)

async def retrieve_sic(
self,
*,
input: str,
max_results: int | Omit = omit,
min_results: int | Omit = omit,
timeout_ms: int | Omit = omit,
type: Literal["original_sic", "latest_sec"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> IndustryRetrieveSicResponse:
"""
Classify any brand into Standard Industrial Classification (SIC) codes from its
domain or name. Choose between the original 1987 SIC system (`original_sic`) or
the latest SIC list maintained by the SEC (`latest_sec`).

Args:
input: Brand domain or title to retrieve SIC code for. If a valid domain is provided,
it will be used for classification, otherwise, we will search for the brand
using the provided title.

max_results: Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.

min_results: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.

timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
than this value, it will be aborted with a 408 status code. Maximum allowed
value is 300000ms (5 minutes).

type: Which SIC dataset to classify against. `original_sic` uses the 1987 Standard
Industrial Classification system; `latest_sec` uses the current SIC list as
published by the SEC. Defaults to `original_sic`.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/web/sic",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{
"input": input,
"max_results": max_results,
"min_results": min_results,
"timeout_ms": timeout_ms,
"type": type,
},
industry_retrieve_sic_params.IndustryRetrieveSicParams,
),
),
cast_to=IndustryRetrieveSicResponse,
)


class IndustryResourceWithRawResponse:
def __init__(self, industry: IndustryResource) -> None:
Expand All @@ -188,6 +323,9 @@ def __init__(self, industry: IndustryResource) -> None:
self.retrieve_naics = to_raw_response_wrapper(
industry.retrieve_naics,
)
self.retrieve_sic = to_raw_response_wrapper(
industry.retrieve_sic,
)


class AsyncIndustryResourceWithRawResponse:
Expand All @@ -197,6 +335,9 @@ def __init__(self, industry: AsyncIndustryResource) -> None:
self.retrieve_naics = async_to_raw_response_wrapper(
industry.retrieve_naics,
)
self.retrieve_sic = async_to_raw_response_wrapper(
industry.retrieve_sic,
)


class IndustryResourceWithStreamingResponse:
Expand All @@ -206,6 +347,9 @@ def __init__(self, industry: IndustryResource) -> None:
self.retrieve_naics = to_streamed_response_wrapper(
industry.retrieve_naics,
)
self.retrieve_sic = to_streamed_response_wrapper(
industry.retrieve_sic,
)


class AsyncIndustryResourceWithStreamingResponse:
Expand All @@ -215,3 +359,6 @@ def __init__(self, industry: AsyncIndustryResource) -> None:
self.retrieve_naics = async_to_streamed_response_wrapper(
industry.retrieve_naics,
)
self.retrieve_sic = async_to_streamed_response_wrapper(
industry.retrieve_sic,
)
2 changes: 2 additions & 0 deletions src/context/dev/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .web_web_scrape_md_response import WebWebScrapeMdResponse as WebWebScrapeMdResponse
from .ai_extract_product_response import AIExtractProductResponse as AIExtractProductResponse
from .ai_extract_products_response import AIExtractProductsResponse as AIExtractProductsResponse
from .industry_retrieve_sic_params import IndustryRetrieveSicParams as IndustryRetrieveSicParams
from .web_web_scrape_html_response import WebWebScrapeHTMLResponse as WebWebScrapeHTMLResponse
from .web_web_scrape_images_params import WebWebScrapeImagesParams as WebWebScrapeImagesParams
from .brand_retrieve_by_isin_params import BrandRetrieveByIsinParams as BrandRetrieveByIsinParams
Expand All @@ -29,6 +30,7 @@
from .web_web_scrape_sitemap_params import WebWebScrapeSitemapParams as WebWebScrapeSitemapParams
from .brand_retrieve_by_email_params import BrandRetrieveByEmailParams as BrandRetrieveByEmailParams
from .industry_retrieve_naics_params import IndustryRetrieveNaicsParams as IndustryRetrieveNaicsParams
from .industry_retrieve_sic_response import IndustryRetrieveSicResponse as IndustryRetrieveSicResponse
from .web_web_scrape_images_response import WebWebScrapeImagesResponse as WebWebScrapeImagesResponse
from .brand_retrieve_by_isin_response import BrandRetrieveByIsinResponse as BrandRetrieveByIsinResponse
from .brand_retrieve_by_name_response import BrandRetrieveByNameResponse as BrandRetrieveByNameResponse
Expand Down
39 changes: 39 additions & 0 deletions src/context/dev/types/industry_retrieve_sic_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, Required, Annotated, TypedDict

from .._utils import PropertyInfo

__all__ = ["IndustryRetrieveSicParams"]


class IndustryRetrieveSicParams(TypedDict, total=False):
input: Required[str]
"""Brand domain or title to retrieve SIC code for.

If a valid domain is provided, it will be used for classification, otherwise, we
will search for the brand using the provided title.
"""

max_results: Annotated[int, PropertyInfo(alias="maxResults")]
"""Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5."""

min_results: Annotated[int, PropertyInfo(alias="minResults")]
"""Minimum number of SIC codes to return. Must be at least 1. Defaults to 1."""

timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
"""Optional timeout in milliseconds for the request.

If the request takes longer than this value, it will be aborted with a 408
status code. Maximum allowed value is 300000ms (5 minutes).
"""

type: Literal["original_sic", "latest_sec"]
"""Which SIC dataset to classify against.

`original_sic` uses the 1987 Standard Industrial Classification system;
`latest_sec` uses the current SIC list as published by the SEC. Defaults to
`original_sic`.
"""
61 changes: 61 additions & 0 deletions src/context/dev/types/industry_retrieve_sic_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from .._models import BaseModel

__all__ = ["IndustryRetrieveSicResponse", "Code"]


class Code(BaseModel):
code: str
"""SIC code (4-digit)."""

confidence: Literal["high", "medium", "low"]
"""Confidence level for how well this SIC code matches the company description."""

name: str
"""SIC industry title."""

major_group: Optional[str] = FieldInfo(alias="majorGroup", default=None)
"""2-digit major group identifier (the leading two digits of the code).

Only present when `classification` is `original_sic`.
"""

major_group_name: Optional[str] = FieldInfo(alias="majorGroupName", default=None)
"""Description of the 2-digit major group.

Only present when `classification` is `original_sic`.
"""

office: Optional[str] = None
"""SEC review office responsible for filings under this code.

Only present when `classification` is `latest_sec`.
"""


class IndustryRetrieveSicResponse(BaseModel):
classification: Optional[Literal["original_sic", "latest_sec"]] = None
"""Echoes back which SIC dataset was used to classify the brand."""

codes: Optional[List[Code]] = None
"""Array of SIC codes with confidence scores.

Extra fields depend on the requested classification: `original_sic` results
include `majorGroup` and `majorGroupName`; `latest_sec` results include
`office`.
"""

domain: Optional[str] = None
"""Domain found for the brand"""

status: Optional[str] = None
"""Status of the response, e.g., 'ok'"""

type: Optional[str] = None
"""Industry classification type, for sic api it will be `sic`"""
Loading
Loading