Skip to content

Commit 1b97c47

Browse files
authored
Merge pull request #29 from brand-dot-dev/release-please--branches--main--changes--next
release: 1.23.0
2 parents 1e37201 + d49bf00 commit 1b97c47

14 files changed

Lines changed: 318 additions & 23 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.22.0"
2+
".": "1.23.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: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-fff3572a2d6f3a8461fbf52fb74882e1f4ae4a2b31a75673dcae230b336911d2.yml
3-
openapi_spec_hash: b04ce3c7879b31f1e38cd76372e8e652
4-
config_hash: 86160e220c81f47769a71c9343e486d8
1+
configured_endpoints: 13
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-f69782c2c4296df9db6b41a3a7359a9e4910f59e34901b9f0e8045cec3f9ca69.yml
3+
openapi_spec_hash: f06c3956a6fc7e57614b120910339747
4+
config_hash: 6aaf0fe6f8877c9c5d9af95597123cb4

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.23.0 (2025-11-29)
4+
5+
Full Changelog: [v1.22.0...v1.23.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.22.0...v1.23.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([d95285a](https://github.com/brand-dot-dev/python-sdk/commit/d95285ae339e8df4d50e793e7c9938ac226974f1))
10+
11+
12+
### Bug Fixes
13+
14+
* ensure streams are always closed ([77df827](https://github.com/brand-dot-dev/python-sdk/commit/77df827c2608b4326d707c0ecbc93d7ec83957d5))
15+
16+
17+
### Chores
18+
19+
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([eedd772](https://github.com/brand-dot-dev/python-sdk/commit/eedd772cb757bcff196b6ed21ac9e887b8423fe0))
20+
321
## 1.22.0 (2025-11-24)
422

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

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Types:
66
from brand.dev.types import (
77
BrandRetrieveResponse,
88
BrandAIQueryResponse,
9+
BrandFontsResponse,
910
BrandIdentifyFromTransactionResponse,
1011
BrandPrefetchResponse,
1112
BrandRetrieveByEmailResponse,
@@ -23,6 +24,7 @@ Methods:
2324

2425
- <code title="get /brand/retrieve">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_response.py">BrandRetrieveResponse</a></code>
2526
- <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>
27+
- <code title="get /brand/fonts">client.brand.<a href="./src/brand/dev/resources/brand.py">fonts</a>(\*\*<a href="src/brand/dev/types/brand_fonts_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_fonts_response.py">BrandFontsResponse</a></code>
2628
- <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>
2729
- <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>
2830
- <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>

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "brand.dev"
3-
version = "1.22.0"
3+
version = "1.23.0"
44
description = "The official Python library for the brand.dev API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -46,7 +46,7 @@ managed = true
4646
# version pins are in requirements-dev.lock
4747
dev-dependencies = [
4848
"pyright==1.1.399",
49-
"mypy",
49+
"mypy==1.17",
5050
"respx",
5151
"pytest",
5252
"pytest-asyncio",

requirements-dev.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ mdurl==0.1.2
7272
multidict==6.4.4
7373
# via aiohttp
7474
# via yarl
75-
mypy==1.14.1
75+
mypy==1.17.0
7676
mypy-extensions==1.0.0
7777
# via mypy
7878
nodeenv==1.8.0
@@ -81,6 +81,8 @@ nox==2023.4.22
8181
packaging==23.2
8282
# via nox
8383
# via pytest
84+
pathspec==0.12.1
85+
# via mypy
8486
platformdirs==3.11.0
8587
# via virtualenv
8688
pluggy==1.5.0

requirements.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.11.9
58+
pydantic==2.12.5
5959
# via brand-dev
60-
pydantic-core==2.33.2
60+
pydantic-core==2.41.5
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
6464
# via brand-dev
65-
typing-extensions==4.12.2
65+
typing-extensions==4.15.0
6666
# via anyio
6767
# via brand-dev
6868
# via multidict
6969
# via pydantic
7070
# via pydantic-core
7171
# via typing-inspection
72-
typing-inspection==0.4.1
72+
typing-inspection==0.4.2
7373
# via pydantic
7474
yarl==1.20.0
7575
# via aiohttp

src/brand/dev/_streaming.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]:
5454
process_data = self._client._process_response_data
5555
iterator = self._iter_events()
5656

57-
for sse in iterator:
58-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
59-
60-
# As we might not fully consume the response stream, we need to close it explicitly
61-
response.close()
57+
try:
58+
for sse in iterator:
59+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
60+
finally:
61+
# Ensure the response is closed even if the consumer doesn't read all data
62+
response.close()
6263

6364
def __enter__(self) -> Self:
6465
return self
@@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]:
117118
process_data = self._client._process_response_data
118119
iterator = self._iter_events()
119120

120-
async for sse in iterator:
121-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
122-
123-
# As we might not fully consume the response stream, we need to close it explicitly
124-
await response.aclose()
121+
try:
122+
async for sse in iterator:
123+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
124+
finally:
125+
# Ensure the response is closed even if the consumer doesn't read all data
126+
await response.aclose()
125127

126128
async def __aenter__(self) -> Self:
127129
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.22.0" # x-release-please-version
4+
__version__ = "1.23.0" # x-release-please-version

src/brand/dev/resources/brand.py

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import httpx
99

1010
from ..types import (
11+
brand_fonts_params,
1112
brand_ai_query_params,
1213
brand_prefetch_params,
1314
brand_retrieve_params,
@@ -32,6 +33,7 @@
3233
async_to_streamed_response_wrapper,
3334
)
3435
from .._base_client import make_request_options
36+
from ..types.brand_fonts_response import BrandFontsResponse
3537
from ..types.brand_ai_query_response import BrandAIQueryResponse
3638
from ..types.brand_prefetch_response import BrandPrefetchResponse
3739
from ..types.brand_retrieve_response import BrandRetrieveResponse
@@ -239,6 +241,56 @@ def ai_query(
239241
cast_to=BrandAIQueryResponse,
240242
)
241243

244+
def fonts(
245+
self,
246+
*,
247+
domain: str,
248+
timeout_ms: int | Omit = omit,
249+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
250+
# The extra values given here take precedence over values defined on the client or passed to this method.
251+
extra_headers: Headers | None = None,
252+
extra_query: Query | None = None,
253+
extra_body: Body | None = None,
254+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
255+
) -> BrandFontsResponse:
256+
"""
257+
Beta feature: Extract font information from a brand's website including font
258+
families, usage statistics, fallbacks, and element/word counts.
259+
260+
Args:
261+
domain: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
262+
domain will be automatically normalized and validated.
263+
264+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
265+
than this value, it will be aborted with a 408 status code. Maximum allowed
266+
value is 300000ms (5 minutes).
267+
268+
extra_headers: Send extra headers
269+
270+
extra_query: Add additional query parameters to the request
271+
272+
extra_body: Add additional JSON properties to the request
273+
274+
timeout: Override the client-level default timeout for this request, in seconds
275+
"""
276+
return self._get(
277+
"/brand/fonts",
278+
options=make_request_options(
279+
extra_headers=extra_headers,
280+
extra_query=extra_query,
281+
extra_body=extra_body,
282+
timeout=timeout,
283+
query=maybe_transform(
284+
{
285+
"domain": domain,
286+
"timeout_ms": timeout_ms,
287+
},
288+
brand_fonts_params.BrandFontsParams,
289+
),
290+
),
291+
cast_to=BrandFontsResponse,
292+
)
293+
242294
def identify_from_transaction(
243295
self,
244296
*,
@@ -1612,6 +1664,56 @@ async def ai_query(
16121664
cast_to=BrandAIQueryResponse,
16131665
)
16141666

1667+
async def fonts(
1668+
self,
1669+
*,
1670+
domain: str,
1671+
timeout_ms: int | Omit = omit,
1672+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1673+
# The extra values given here take precedence over values defined on the client or passed to this method.
1674+
extra_headers: Headers | None = None,
1675+
extra_query: Query | None = None,
1676+
extra_body: Body | None = None,
1677+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1678+
) -> BrandFontsResponse:
1679+
"""
1680+
Beta feature: Extract font information from a brand's website including font
1681+
families, usage statistics, fallbacks, and element/word counts.
1682+
1683+
Args:
1684+
domain: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
1685+
domain will be automatically normalized and validated.
1686+
1687+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
1688+
than this value, it will be aborted with a 408 status code. Maximum allowed
1689+
value is 300000ms (5 minutes).
1690+
1691+
extra_headers: Send extra headers
1692+
1693+
extra_query: Add additional query parameters to the request
1694+
1695+
extra_body: Add additional JSON properties to the request
1696+
1697+
timeout: Override the client-level default timeout for this request, in seconds
1698+
"""
1699+
return await self._get(
1700+
"/brand/fonts",
1701+
options=make_request_options(
1702+
extra_headers=extra_headers,
1703+
extra_query=extra_query,
1704+
extra_body=extra_body,
1705+
timeout=timeout,
1706+
query=await async_maybe_transform(
1707+
{
1708+
"domain": domain,
1709+
"timeout_ms": timeout_ms,
1710+
},
1711+
brand_fonts_params.BrandFontsParams,
1712+
),
1713+
),
1714+
cast_to=BrandFontsResponse,
1715+
)
1716+
16151717
async def identify_from_transaction(
16161718
self,
16171719
*,
@@ -2804,6 +2906,9 @@ def __init__(self, brand: BrandResource) -> None:
28042906
self.ai_query = to_raw_response_wrapper(
28052907
brand.ai_query,
28062908
)
2909+
self.fonts = to_raw_response_wrapper(
2910+
brand.fonts,
2911+
)
28072912
self.identify_from_transaction = to_raw_response_wrapper(
28082913
brand.identify_from_transaction,
28092914
)
@@ -2846,6 +2951,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
28462951
self.ai_query = async_to_raw_response_wrapper(
28472952
brand.ai_query,
28482953
)
2954+
self.fonts = async_to_raw_response_wrapper(
2955+
brand.fonts,
2956+
)
28492957
self.identify_from_transaction = async_to_raw_response_wrapper(
28502958
brand.identify_from_transaction,
28512959
)
@@ -2888,6 +2996,9 @@ def __init__(self, brand: BrandResource) -> None:
28882996
self.ai_query = to_streamed_response_wrapper(
28892997
brand.ai_query,
28902998
)
2999+
self.fonts = to_streamed_response_wrapper(
3000+
brand.fonts,
3001+
)
28913002
self.identify_from_transaction = to_streamed_response_wrapper(
28923003
brand.identify_from_transaction,
28933004
)
@@ -2930,6 +3041,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
29303041
self.ai_query = async_to_streamed_response_wrapper(
29313042
brand.ai_query,
29323043
)
3044+
self.fonts = async_to_streamed_response_wrapper(
3045+
brand.fonts,
3046+
)
29333047
self.identify_from_transaction = async_to_streamed_response_wrapper(
29343048
brand.identify_from_transaction,
29353049
)

0 commit comments

Comments
 (0)