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.35.0"
".": "1.36.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3614380ba4315687bbaf6561e9872fd72dd876f9230ce690c35d7efc1250e808.yml
openapi_spec_hash: f1aa17e08d0379766a61de68714c7c21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-584d3486a6c5bf7b68dcaacb0bde2ef5f648c158e5c5ebccc7a7684d95abc832.yml
openapi_spec_hash: 29a53e1f96a2c5d9407f1a0938e301bf
config_hash: 4cd3173ea1cce7183640aae49cfbb374
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 1.36.0 (2026-03-01)

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

### Features

* **api:** api update ([06eeb90](https://github.com/brand-dot-dev/python-sdk/commit/06eeb901097ef65fc3bd748262ee0535fedbd41f))
* **api:** api update ([99080ad](https://github.com/brand-dot-dev/python-sdk/commit/99080ade4047eba1c61b35aa5244ca139d259b2b))


### Chores

* **internal:** add request options to SSE classes ([2c7a465](https://github.com/brand-dot-dev/python-sdk/commit/2c7a465cd6c6af51ee31c51e654197c5b2f2141c))
* **internal:** make `test_proxy_environment_variables` more resilient ([481029b](https://github.com/brand-dot-dev/python-sdk/commit/481029be8d533936b4078d6eeecf135b102463c3))
* **internal:** make `test_proxy_environment_variables` more resilient to env ([b7ecf85](https://github.com/brand-dot-dev/python-sdk/commit/b7ecf85a40b0f93e742349f13b986f1263a2cc73))

## 1.35.0 (2026-02-24)

Full Changelog: [v1.34.0...v1.35.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.34.0...v1.35.0)
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.35.0"
version = "1.36.0"
description = "The official Python library for the brand.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
3 changes: 3 additions & 0 deletions src/brand/dev/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
),
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand All @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=extract_stream_chunk_type(self._stream_cls),
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand All @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=cast_to,
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand Down
11 changes: 8 additions & 3 deletions src/brand/dev/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import inspect
from types import TracebackType
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable

import httpx
Expand All @@ -13,6 +13,7 @@

if TYPE_CHECKING:
from ._client import BrandDev, AsyncBrandDev
from ._models import FinalRequestOptions


_T = TypeVar("_T")
Expand All @@ -22,7 +23,7 @@ class Stream(Generic[_T]):
"""Provides the core interface to iterate over a synchronous stream response."""

response: httpx.Response

_options: Optional[FinalRequestOptions] = None
_decoder: SSEBytesDecoder

def __init__(
Expand All @@ -31,10 +32,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: BrandDev,
options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()

Expand Down Expand Up @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
"""Provides the core interface to iterate over an asynchronous stream response."""

response: httpx.Response

_options: Optional[FinalRequestOptions] = None
_decoder: SSEDecoder | SSEBytesDecoder

def __init__(
Expand All @@ -94,10 +97,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: AsyncBrandDev,
options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()

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.35.0" # x-release-please-version
__version__ = "1.36.0" # x-release-please-version
20 changes: 20 additions & 0 deletions src/brand/dev/resources/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ def identify_from_transaction(
"welsh",
]
| Omit = omit,
high_confidence_only: bool | Omit = omit,
max_speed: bool | Omit = omit,
mcc: str | Omit = omit,
phone: float | Omit = omit,
Expand All @@ -787,6 +788,10 @@ def identify_from_transaction(

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

high_confidence_only: When set to true, the API will perform an additional verification steps to
ensure the identified brand matches the transaction with high confidence.
Defaults to false.

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.
Expand Down Expand Up @@ -821,6 +826,7 @@ def identify_from_transaction(
"city": city,
"country_gl": country_gl,
"force_language": force_language,
"high_confidence_only": high_confidence_only,
"max_speed": max_speed,
"mcc": mcc,
"phone": phone,
Expand Down Expand Up @@ -1797,6 +1803,7 @@ def web_scrape_md(
url: str,
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
shorten_base64_images: bool | 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,
Expand All @@ -1817,6 +1824,8 @@ def web_scrape_md(

include_links: Preserve hyperlinks in Markdown output

shorten_base64_images: Shorten base64-encoded image data in the Markdown output

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -1837,6 +1846,7 @@ def web_scrape_md(
"url": url,
"include_images": include_images,
"include_links": include_links,
"shorten_base64_images": shorten_base64_images,
},
brand_web_scrape_md_params.BrandWebScrapeMdParams,
),
Expand Down Expand Up @@ -2583,6 +2593,7 @@ async def identify_from_transaction(
"welsh",
]
| Omit = omit,
high_confidence_only: bool | Omit = omit,
max_speed: bool | Omit = omit,
mcc: str | Omit = omit,
phone: float | Omit = omit,
Expand All @@ -2608,6 +2619,10 @@ async def identify_from_transaction(

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

high_confidence_only: When set to true, the API will perform an additional verification steps to
ensure the identified brand matches the transaction with high confidence.
Defaults to false.

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.
Expand Down Expand Up @@ -2642,6 +2657,7 @@ async def identify_from_transaction(
"city": city,
"country_gl": country_gl,
"force_language": force_language,
"high_confidence_only": high_confidence_only,
"max_speed": max_speed,
"mcc": mcc,
"phone": phone,
Expand Down Expand Up @@ -3620,6 +3636,7 @@ async def web_scrape_md(
url: str,
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
shorten_base64_images: bool | 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,
Expand All @@ -3640,6 +3657,8 @@ async def web_scrape_md(

include_links: Preserve hyperlinks in Markdown output

shorten_base64_images: Shorten base64-encoded image data in the Markdown output

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -3660,6 +3679,7 @@ async def web_scrape_md(
"url": url,
"include_images": include_images,
"include_links": include_links,
"shorten_base64_images": shorten_base64_images,
},
brand_web_scrape_md_params.BrandWebScrapeMdParams,
),
Expand Down
7 changes: 7 additions & 0 deletions src/brand/dev/types/brand_identify_from_transaction_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ class BrandIdentifyFromTransactionParams(TypedDict, total=False):
]
"""Optional parameter to force the language of the retrieved brand data."""

high_confidence_only: bool
"""
When set to true, the API will perform an additional verification steps to
ensure the identified brand matches the transaction with high confidence.
Defaults to false.
"""

max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
"""Optional parameter to optimize the API call for maximum speed.

Expand Down
3 changes: 3 additions & 0 deletions src/brand/dev/types/brand_web_scrape_md_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ class BrandWebScrapeMdParams(TypedDict, total=False):

include_links: Annotated[bool, PropertyInfo(alias="includeLinks")]
"""Preserve hyperlinks in Markdown output"""

shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
"""Shorten base64-encoded image data in the Markdown output"""
4 changes: 4 additions & 0 deletions tests/api_resources/test_brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ def test_method_identify_from_transaction_with_all_params(self, client: BrandDev
city="city",
country_gl="ad",
force_language="albanian",
high_confidence_only=True,
max_speed=True,
mcc="mcc",
phone=0,
Expand Down Expand Up @@ -919,6 +920,7 @@ def test_method_web_scrape_md_with_all_params(self, client: BrandDev) -> None:
url="https://example.com",
include_images=True,
include_links=True,
shorten_base64_images=True,
)
assert_matches_type(BrandWebScrapeMdResponse, brand, path=["response"])

Expand Down Expand Up @@ -1314,6 +1316,7 @@ async def test_method_identify_from_transaction_with_all_params(self, async_clie
city="city",
country_gl="ad",
force_language="albanian",
high_confidence_only=True,
max_speed=True,
mcc="mcc",
phone=0,
Expand Down Expand Up @@ -1869,6 +1872,7 @@ async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncBra
url="https://example.com",
include_images=True,
include_links=True,
shorten_base64_images=True,
)
assert_matches_type(BrandWebScrapeMdResponse, brand, path=["response"])

Expand Down
16 changes: 16 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
# Delete in case our environment has any proxy env vars set
monkeypatch.delenv("HTTP_PROXY", raising=False)
monkeypatch.delenv("ALL_PROXY", raising=False)
monkeypatch.delenv("NO_PROXY", raising=False)
monkeypatch.delenv("http_proxy", raising=False)
monkeypatch.delenv("https_proxy", raising=False)
monkeypatch.delenv("all_proxy", raising=False)
monkeypatch.delenv("no_proxy", raising=False)

client = DefaultHttpxClient()

Expand Down Expand Up @@ -1861,6 +1869,14 @@ async def test_get_platform(self) -> None:
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
# Delete in case our environment has any proxy env vars set
monkeypatch.delenv("HTTP_PROXY", raising=False)
monkeypatch.delenv("ALL_PROXY", raising=False)
monkeypatch.delenv("NO_PROXY", raising=False)
monkeypatch.delenv("http_proxy", raising=False)
monkeypatch.delenv("https_proxy", raising=False)
monkeypatch.delenv("all_proxy", raising=False)
monkeypatch.delenv("no_proxy", raising=False)

client = DefaultAsyncHttpxClient()

Expand Down