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 @@
{
".": "1.18.0"
".": "1.19.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: 10
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a634e2867f22f7485bf8ef51d18a25c010274dcbd60a420c8b35e68d017c8c95.yml
openapi_spec_hash: 8990e4b274d4563c77525b15a2723f63
config_hash: a1303564edd6276a63d584a02b2238b2
configured_endpoints: 11
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-6620330945de41f1c453692af40842f08fe1fd281ff6ba4e79d447c941ebd783.yml
openapi_spec_hash: 861a43669d27d942d4bd3e36a398e95b
config_hash: 083e432ea397a9018371145493400188
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 1.19.0 (2025-10-31)

Full Changelog: [v1.18.0...v1.19.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.18.0...v1.19.0)

### Features

* **api:** manual updates ([887cd82](https://github.com/brand-dot-dev/python-sdk/commit/887cd82aaf78b8752cbf2fe8956ce81a9905d882))


### Bug Fixes

* **client:** close streams without requiring full consumption ([8c87170](https://github.com/brand-dot-dev/python-sdk/commit/8c8717069bf064ca9a467b1c478ed642a10d5342))


### Chores

* **internal/tests:** avoid race condition with implicit client cleanup ([ccaa28b](https://github.com/brand-dot-dev/python-sdk/commit/ccaa28b34cfbd24a0f46371dca4e43ab7a15fa61))

## 1.18.0 (2025-10-30)

Full Changelog: [v1.17.1...v1.18.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.17.1...v1.18.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ from brand.dev.types import (
BrandAIQueryResponse,
BrandIdentifyFromTransactionResponse,
BrandPrefetchResponse,
BrandRetrieveByEmailResponse,
BrandRetrieveByNameResponse,
BrandRetrieveByTickerResponse,
BrandRetrieveNaicsResponse,
Expand All @@ -23,6 +24,7 @@ Methods:
- <code title="post /brand/ai/query">client.brand.<a href="./src/brand/dev/resources/brand.py">ai_query</a>(\*\*<a href="src/brand/dev/types/brand_ai_query_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_ai_query_response.py">BrandAIQueryResponse</a></code>
- <code title="get /brand/transaction_identifier">client.brand.<a href="./src/brand/dev/resources/brand.py">identify_from_transaction</a>(\*\*<a href="src/brand/dev/types/brand_identify_from_transaction_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_identify_from_transaction_response.py">BrandIdentifyFromTransactionResponse</a></code>
- <code title="post /brand/prefetch">client.brand.<a href="./src/brand/dev/resources/brand.py">prefetch</a>(\*\*<a href="src/brand/dev/types/brand_prefetch_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_prefetch_response.py">BrandPrefetchResponse</a></code>
- <code title="get /brand/retrieve-by-email">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_email</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_email_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_email_response.py">BrandRetrieveByEmailResponse</a></code>
- <code title="get /brand/retrieve-by-name">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_name</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_name_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_name_response.py">BrandRetrieveByNameResponse</a></code>
- <code title="get /brand/retrieve-by-ticker">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_ticker</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_ticker_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_ticker_response.py">BrandRetrieveByTickerResponse</a></code>
- <code title="get /brand/naics">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_naics</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_naics_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_naics_response.py">BrandRetrieveNaicsResponse</a></code>
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 = "brand.dev"
version = "1.18.0"
version = "1.19.0"
description = "The official Python library for the brand.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
10 changes: 4 additions & 6 deletions src/brand/dev/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]:
for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
response.close()

def __enter__(self) -> Self:
return self
Expand Down Expand Up @@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
async for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
async for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
await response.aclose()

async def __aenter__(self) -> Self:
return self
Expand Down
2 changes: 1 addition & 1 deletion src/brand/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__ = "brand.dev"
__version__ = "1.18.0" # x-release-please-version
__version__ = "1.19.0" # x-release-please-version
248 changes: 248 additions & 0 deletions src/brand/dev/resources/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
brand_styleguide_params,
brand_retrieve_naics_params,
brand_retrieve_by_name_params,
brand_retrieve_by_email_params,
brand_retrieve_by_ticker_params,
brand_retrieve_simplified_params,
brand_identify_from_transaction_params,
Expand All @@ -37,6 +38,7 @@
from ..types.brand_styleguide_response import BrandStyleguideResponse
from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse
from ..types.brand_retrieve_by_name_response import BrandRetrieveByNameResponse
from ..types.brand_retrieve_by_email_response import BrandRetrieveByEmailResponse
from ..types.brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse
from ..types.brand_retrieve_simplified_response import BrandRetrieveSimplifiedResponse
from ..types.brand_identify_from_transaction_response import BrandIdentifyFromTransactionResponse
Expand Down Expand Up @@ -396,6 +398,123 @@ def prefetch(
cast_to=BrandPrefetchResponse,
)

def retrieve_by_email(
self,
*,
email: str,
force_language: Literal[
"albanian",
"arabic",
"azeri",
"bengali",
"bulgarian",
"cebuano",
"croatian",
"czech",
"danish",
"dutch",
"english",
"estonian",
"farsi",
"finnish",
"french",
"german",
"hausa",
"hawaiian",
"hindi",
"hungarian",
"icelandic",
"indonesian",
"italian",
"kazakh",
"kyrgyz",
"latin",
"latvian",
"lithuanian",
"macedonian",
"mongolian",
"nepali",
"norwegian",
"pashto",
"pidgin",
"polish",
"portuguese",
"romanian",
"russian",
"serbian",
"slovak",
"slovene",
"somali",
"spanish",
"swahili",
"swedish",
"tagalog",
"turkish",
"ukrainian",
"urdu",
"uzbek",
"vietnamese",
"welsh",
]
| Omit = omit,
max_speed: bool | Omit = omit,
timeout_ms: int | 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,
) -> BrandRetrieveByEmailResponse:
"""
Retrieve brand information using an email address while detecting disposable and
free email addresses. This endpoint extracts the domain from the email address
and returns brand data for that domain. Disposable and free email addresses
(like gmail.com, yahoo.com) will throw a 422 error.

Args:
email: Email address to retrieve brand data for (e.g., 'contact@example.com'). The
domain will be extracted from the email. Free email providers (gmail.com,
yahoo.com, etc.) and disposable email addresses are not allowed.

force_language: Optional parameter to force the language of the retrieved brand data.

max_speed: Optional parameter to optimize the API call for maximum speed. When set to true,
the API will skip time-consuming operations for faster response at the cost of
less comprehensive data.

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).

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(
"/brand/retrieve-by-email",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"email": email,
"force_language": force_language,
"max_speed": max_speed,
"timeout_ms": timeout_ms,
},
brand_retrieve_by_email_params.BrandRetrieveByEmailParams,
),
),
cast_to=BrandRetrieveByEmailResponse,
)

def retrieve_by_name(
self,
*,
Expand Down Expand Up @@ -1281,6 +1400,123 @@ async def prefetch(
cast_to=BrandPrefetchResponse,
)

async def retrieve_by_email(
self,
*,
email: str,
force_language: Literal[
"albanian",
"arabic",
"azeri",
"bengali",
"bulgarian",
"cebuano",
"croatian",
"czech",
"danish",
"dutch",
"english",
"estonian",
"farsi",
"finnish",
"french",
"german",
"hausa",
"hawaiian",
"hindi",
"hungarian",
"icelandic",
"indonesian",
"italian",
"kazakh",
"kyrgyz",
"latin",
"latvian",
"lithuanian",
"macedonian",
"mongolian",
"nepali",
"norwegian",
"pashto",
"pidgin",
"polish",
"portuguese",
"romanian",
"russian",
"serbian",
"slovak",
"slovene",
"somali",
"spanish",
"swahili",
"swedish",
"tagalog",
"turkish",
"ukrainian",
"urdu",
"uzbek",
"vietnamese",
"welsh",
]
| Omit = omit,
max_speed: bool | Omit = omit,
timeout_ms: int | 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,
) -> BrandRetrieveByEmailResponse:
"""
Retrieve brand information using an email address while detecting disposable and
free email addresses. This endpoint extracts the domain from the email address
and returns brand data for that domain. Disposable and free email addresses
(like gmail.com, yahoo.com) will throw a 422 error.

Args:
email: Email address to retrieve brand data for (e.g., 'contact@example.com'). The
domain will be extracted from the email. Free email providers (gmail.com,
yahoo.com, etc.) and disposable email addresses are not allowed.

force_language: Optional parameter to force the language of the retrieved brand data.

max_speed: Optional parameter to optimize the API call for maximum speed. When set to true,
the API will skip time-consuming operations for faster response at the cost of
less comprehensive data.

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).

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(
"/brand/retrieve-by-email",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{
"email": email,
"force_language": force_language,
"max_speed": max_speed,
"timeout_ms": timeout_ms,
},
brand_retrieve_by_email_params.BrandRetrieveByEmailParams,
),
),
cast_to=BrandRetrieveByEmailResponse,
)

async def retrieve_by_name(
self,
*,
Expand Down Expand Up @@ -1830,6 +2066,9 @@ def __init__(self, brand: BrandResource) -> None:
self.prefetch = to_raw_response_wrapper(
brand.prefetch,
)
self.retrieve_by_email = to_raw_response_wrapper(
brand.retrieve_by_email,
)
self.retrieve_by_name = to_raw_response_wrapper(
brand.retrieve_by_name,
)
Expand Down Expand Up @@ -1866,6 +2105,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
self.prefetch = async_to_raw_response_wrapper(
brand.prefetch,
)
self.retrieve_by_email = async_to_raw_response_wrapper(
brand.retrieve_by_email,
)
self.retrieve_by_name = async_to_raw_response_wrapper(
brand.retrieve_by_name,
)
Expand Down Expand Up @@ -1902,6 +2144,9 @@ def __init__(self, brand: BrandResource) -> None:
self.prefetch = to_streamed_response_wrapper(
brand.prefetch,
)
self.retrieve_by_email = to_streamed_response_wrapper(
brand.retrieve_by_email,
)
self.retrieve_by_name = to_streamed_response_wrapper(
brand.retrieve_by_name,
)
Expand Down Expand Up @@ -1938,6 +2183,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
self.prefetch = async_to_streamed_response_wrapper(
brand.prefetch,
)
self.retrieve_by_email = async_to_streamed_response_wrapper(
brand.retrieve_by_email,
)
self.retrieve_by_name = async_to_streamed_response_wrapper(
brand.retrieve_by_name,
)
Expand Down
Loading