Skip to content

Commit fdd8c88

Browse files
authored
Merge pull request #24 from brand-dot-dev/release-please--branches--main--changes--next
release: 1.19.0
2 parents 4b332e3 + 562a050 commit fdd8c88

13 files changed

Lines changed: 1139 additions & 177 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.18.0"
2+
".": "1.19.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a634e2867f22f7485bf8ef51d18a25c010274dcbd60a420c8b35e68d017c8c95.yml
3-
openapi_spec_hash: 8990e4b274d4563c77525b15a2723f63
4-
config_hash: a1303564edd6276a63d584a02b2238b2
1+
configured_endpoints: 11
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-6620330945de41f1c453692af40842f08fe1fd281ff6ba4e79d447c941ebd783.yml
3+
openapi_spec_hash: 861a43669d27d942d4bd3e36a398e95b
4+
config_hash: 083e432ea397a9018371145493400188

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## 1.19.0 (2025-10-31)
4+
5+
Full Changelog: [v1.18.0...v1.19.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.18.0...v1.19.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([887cd82](https://github.com/brand-dot-dev/python-sdk/commit/887cd82aaf78b8752cbf2fe8956ce81a9905d882))
10+
11+
12+
### Bug Fixes
13+
14+
* **client:** close streams without requiring full consumption ([8c87170](https://github.com/brand-dot-dev/python-sdk/commit/8c8717069bf064ca9a467b1c478ed642a10d5342))
15+
16+
17+
### Chores
18+
19+
* **internal/tests:** avoid race condition with implicit client cleanup ([ccaa28b](https://github.com/brand-dot-dev/python-sdk/commit/ccaa28b34cfbd24a0f46371dca4e43ab7a15fa61))
20+
321
## 1.18.0 (2025-10-30)
422

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

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ from brand.dev.types import (
88
BrandAIQueryResponse,
99
BrandIdentifyFromTransactionResponse,
1010
BrandPrefetchResponse,
11+
BrandRetrieveByEmailResponse,
1112
BrandRetrieveByNameResponse,
1213
BrandRetrieveByTickerResponse,
1314
BrandRetrieveNaicsResponse,
@@ -23,6 +24,7 @@ Methods:
2324
- <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>
2425
- <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>
2526
- <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>
27+
- <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>
2628
- <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>
2729
- <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>
2830
- <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>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "brand.dev"
3-
version = "1.18.0"
3+
version = "1.19.0"
44
description = "The official Python library for the brand.dev API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/brand/dev/_streaming.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]:
5757
for sse in iterator:
5858
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
5959

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

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

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

128126
async def __aenter__(self) -> Self:
129127
return self

src/brand/dev/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "brand.dev"
4-
__version__ = "1.18.0" # x-release-please-version
4+
__version__ = "1.19.0" # x-release-please-version

src/brand/dev/resources/brand.py

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
brand_styleguide_params,
1616
brand_retrieve_naics_params,
1717
brand_retrieve_by_name_params,
18+
brand_retrieve_by_email_params,
1819
brand_retrieve_by_ticker_params,
1920
brand_retrieve_simplified_params,
2021
brand_identify_from_transaction_params,
@@ -37,6 +38,7 @@
3738
from ..types.brand_styleguide_response import BrandStyleguideResponse
3839
from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse
3940
from ..types.brand_retrieve_by_name_response import BrandRetrieveByNameResponse
41+
from ..types.brand_retrieve_by_email_response import BrandRetrieveByEmailResponse
4042
from ..types.brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse
4143
from ..types.brand_retrieve_simplified_response import BrandRetrieveSimplifiedResponse
4244
from ..types.brand_identify_from_transaction_response import BrandIdentifyFromTransactionResponse
@@ -396,6 +398,123 @@ def prefetch(
396398
cast_to=BrandPrefetchResponse,
397399
)
398400

401+
def retrieve_by_email(
402+
self,
403+
*,
404+
email: str,
405+
force_language: Literal[
406+
"albanian",
407+
"arabic",
408+
"azeri",
409+
"bengali",
410+
"bulgarian",
411+
"cebuano",
412+
"croatian",
413+
"czech",
414+
"danish",
415+
"dutch",
416+
"english",
417+
"estonian",
418+
"farsi",
419+
"finnish",
420+
"french",
421+
"german",
422+
"hausa",
423+
"hawaiian",
424+
"hindi",
425+
"hungarian",
426+
"icelandic",
427+
"indonesian",
428+
"italian",
429+
"kazakh",
430+
"kyrgyz",
431+
"latin",
432+
"latvian",
433+
"lithuanian",
434+
"macedonian",
435+
"mongolian",
436+
"nepali",
437+
"norwegian",
438+
"pashto",
439+
"pidgin",
440+
"polish",
441+
"portuguese",
442+
"romanian",
443+
"russian",
444+
"serbian",
445+
"slovak",
446+
"slovene",
447+
"somali",
448+
"spanish",
449+
"swahili",
450+
"swedish",
451+
"tagalog",
452+
"turkish",
453+
"ukrainian",
454+
"urdu",
455+
"uzbek",
456+
"vietnamese",
457+
"welsh",
458+
]
459+
| Omit = omit,
460+
max_speed: bool | Omit = omit,
461+
timeout_ms: int | Omit = omit,
462+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
463+
# The extra values given here take precedence over values defined on the client or passed to this method.
464+
extra_headers: Headers | None = None,
465+
extra_query: Query | None = None,
466+
extra_body: Body | None = None,
467+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
468+
) -> BrandRetrieveByEmailResponse:
469+
"""
470+
Retrieve brand information using an email address while detecting disposable and
471+
free email addresses. This endpoint extracts the domain from the email address
472+
and returns brand data for that domain. Disposable and free email addresses
473+
(like gmail.com, yahoo.com) will throw a 422 error.
474+
475+
Args:
476+
email: Email address to retrieve brand data for (e.g., 'contact@example.com'). The
477+
domain will be extracted from the email. Free email providers (gmail.com,
478+
yahoo.com, etc.) and disposable email addresses are not allowed.
479+
480+
force_language: Optional parameter to force the language of the retrieved brand data.
481+
482+
max_speed: Optional parameter to optimize the API call for maximum speed. When set to true,
483+
the API will skip time-consuming operations for faster response at the cost of
484+
less comprehensive data.
485+
486+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
487+
than this value, it will be aborted with a 408 status code. Maximum allowed
488+
value is 300000ms (5 minutes).
489+
490+
extra_headers: Send extra headers
491+
492+
extra_query: Add additional query parameters to the request
493+
494+
extra_body: Add additional JSON properties to the request
495+
496+
timeout: Override the client-level default timeout for this request, in seconds
497+
"""
498+
return self._get(
499+
"/brand/retrieve-by-email",
500+
options=make_request_options(
501+
extra_headers=extra_headers,
502+
extra_query=extra_query,
503+
extra_body=extra_body,
504+
timeout=timeout,
505+
query=maybe_transform(
506+
{
507+
"email": email,
508+
"force_language": force_language,
509+
"max_speed": max_speed,
510+
"timeout_ms": timeout_ms,
511+
},
512+
brand_retrieve_by_email_params.BrandRetrieveByEmailParams,
513+
),
514+
),
515+
cast_to=BrandRetrieveByEmailResponse,
516+
)
517+
399518
def retrieve_by_name(
400519
self,
401520
*,
@@ -1281,6 +1400,123 @@ async def prefetch(
12811400
cast_to=BrandPrefetchResponse,
12821401
)
12831402

1403+
async def retrieve_by_email(
1404+
self,
1405+
*,
1406+
email: str,
1407+
force_language: Literal[
1408+
"albanian",
1409+
"arabic",
1410+
"azeri",
1411+
"bengali",
1412+
"bulgarian",
1413+
"cebuano",
1414+
"croatian",
1415+
"czech",
1416+
"danish",
1417+
"dutch",
1418+
"english",
1419+
"estonian",
1420+
"farsi",
1421+
"finnish",
1422+
"french",
1423+
"german",
1424+
"hausa",
1425+
"hawaiian",
1426+
"hindi",
1427+
"hungarian",
1428+
"icelandic",
1429+
"indonesian",
1430+
"italian",
1431+
"kazakh",
1432+
"kyrgyz",
1433+
"latin",
1434+
"latvian",
1435+
"lithuanian",
1436+
"macedonian",
1437+
"mongolian",
1438+
"nepali",
1439+
"norwegian",
1440+
"pashto",
1441+
"pidgin",
1442+
"polish",
1443+
"portuguese",
1444+
"romanian",
1445+
"russian",
1446+
"serbian",
1447+
"slovak",
1448+
"slovene",
1449+
"somali",
1450+
"spanish",
1451+
"swahili",
1452+
"swedish",
1453+
"tagalog",
1454+
"turkish",
1455+
"ukrainian",
1456+
"urdu",
1457+
"uzbek",
1458+
"vietnamese",
1459+
"welsh",
1460+
]
1461+
| Omit = omit,
1462+
max_speed: bool | Omit = omit,
1463+
timeout_ms: int | Omit = omit,
1464+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1465+
# The extra values given here take precedence over values defined on the client or passed to this method.
1466+
extra_headers: Headers | None = None,
1467+
extra_query: Query | None = None,
1468+
extra_body: Body | None = None,
1469+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1470+
) -> BrandRetrieveByEmailResponse:
1471+
"""
1472+
Retrieve brand information using an email address while detecting disposable and
1473+
free email addresses. This endpoint extracts the domain from the email address
1474+
and returns brand data for that domain. Disposable and free email addresses
1475+
(like gmail.com, yahoo.com) will throw a 422 error.
1476+
1477+
Args:
1478+
email: Email address to retrieve brand data for (e.g., 'contact@example.com'). The
1479+
domain will be extracted from the email. Free email providers (gmail.com,
1480+
yahoo.com, etc.) and disposable email addresses are not allowed.
1481+
1482+
force_language: Optional parameter to force the language of the retrieved brand data.
1483+
1484+
max_speed: Optional parameter to optimize the API call for maximum speed. When set to true,
1485+
the API will skip time-consuming operations for faster response at the cost of
1486+
less comprehensive data.
1487+
1488+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
1489+
than this value, it will be aborted with a 408 status code. Maximum allowed
1490+
value is 300000ms (5 minutes).
1491+
1492+
extra_headers: Send extra headers
1493+
1494+
extra_query: Add additional query parameters to the request
1495+
1496+
extra_body: Add additional JSON properties to the request
1497+
1498+
timeout: Override the client-level default timeout for this request, in seconds
1499+
"""
1500+
return await self._get(
1501+
"/brand/retrieve-by-email",
1502+
options=make_request_options(
1503+
extra_headers=extra_headers,
1504+
extra_query=extra_query,
1505+
extra_body=extra_body,
1506+
timeout=timeout,
1507+
query=await async_maybe_transform(
1508+
{
1509+
"email": email,
1510+
"force_language": force_language,
1511+
"max_speed": max_speed,
1512+
"timeout_ms": timeout_ms,
1513+
},
1514+
brand_retrieve_by_email_params.BrandRetrieveByEmailParams,
1515+
),
1516+
),
1517+
cast_to=BrandRetrieveByEmailResponse,
1518+
)
1519+
12841520
async def retrieve_by_name(
12851521
self,
12861522
*,
@@ -1830,6 +2066,9 @@ def __init__(self, brand: BrandResource) -> None:
18302066
self.prefetch = to_raw_response_wrapper(
18312067
brand.prefetch,
18322068
)
2069+
self.retrieve_by_email = to_raw_response_wrapper(
2070+
brand.retrieve_by_email,
2071+
)
18332072
self.retrieve_by_name = to_raw_response_wrapper(
18342073
brand.retrieve_by_name,
18352074
)
@@ -1866,6 +2105,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
18662105
self.prefetch = async_to_raw_response_wrapper(
18672106
brand.prefetch,
18682107
)
2108+
self.retrieve_by_email = async_to_raw_response_wrapper(
2109+
brand.retrieve_by_email,
2110+
)
18692111
self.retrieve_by_name = async_to_raw_response_wrapper(
18702112
brand.retrieve_by_name,
18712113
)
@@ -1902,6 +2144,9 @@ def __init__(self, brand: BrandResource) -> None:
19022144
self.prefetch = to_streamed_response_wrapper(
19032145
brand.prefetch,
19042146
)
2147+
self.retrieve_by_email = to_streamed_response_wrapper(
2148+
brand.retrieve_by_email,
2149+
)
19052150
self.retrieve_by_name = to_streamed_response_wrapper(
19062151
brand.retrieve_by_name,
19072152
)
@@ -1938,6 +2183,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
19382183
self.prefetch = async_to_streamed_response_wrapper(
19392184
brand.prefetch,
19402185
)
2186+
self.retrieve_by_email = async_to_streamed_response_wrapper(
2187+
brand.retrieve_by_email,
2188+
)
19412189
self.retrieve_by_name = async_to_streamed_response_wrapper(
19422190
brand.retrieve_by_name,
19432191
)

0 commit comments

Comments
 (0)