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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
Expand Down
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.5.0"
".": "1.6.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: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a960d67a89f2e62fcb3fb61f13e0cba71a803ff00b378730cf72a8209ae8e36a.yml
openapi_spec_hash: a2c7aa9e4b1e5265d502d3f005ffb5f9
config_hash: bb3f3ba0dca413263e40968648f9a1a6
configured_endpoints: 10
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3f6d4c0f819a0d3128951d315ad216df22050fbc47c5f601d261d56f8b1d80a5.yml
openapi_spec_hash: 8e7953259a1b6bd7440a780eccad1742
config_hash: 8f3ee44d690a305369555016a77ed016
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## 1.6.0 (2025-06-19)

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

### Features

* **api:** manual updates ([315c5dc](https://github.com/brand-dot-dev/python-sdk/commit/315c5dcb1aa4982bf5e90b3fbe1223c969234a64))
* **api:** manual updates ([adc4bd6](https://github.com/brand-dot-dev/python-sdk/commit/adc4bd6260c7bc6471fa060b66c1f3e8f368bf07))


### Bug Fixes

* **client:** correctly parse binary response | stream ([26be0c4](https://github.com/brand-dot-dev/python-sdk/commit/26be0c417636a9be6f5b52fd079038b3eeb11484))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([b2bff71](https://github.com/brand-dot-dev/python-sdk/commit/b2bff712704ec48751c0b2ea4f51960913811a98))


### Chores

* **ci:** enable for pull requests ([d908899](https://github.com/brand-dot-dev/python-sdk/commit/d9088990a6b2e760d1a425117848697882a2b5bd))
* **internal:** update conftest.py ([fd16274](https://github.com/brand-dot-dev/python-sdk/commit/fd16274f9eb87fac48f5d746e628f135f98ff052))
* **readme:** update badges ([727b0fa](https://github.com/brand-dot-dev/python-sdk/commit/727b0fa230d8a40abbd1e36e592ba3ba05b6f8eb))
* **tests:** add tests for httpx client instantiation & proxies ([bb70721](https://github.com/brand-dot-dev/python-sdk/commit/bb70721dd5ac47752cc749ac9269eb4e7d1bb6d4))
* **tests:** run tests in parallel ([b12584c](https://github.com/brand-dot-dev/python-sdk/commit/b12584c87749c3a9e06653418a9e3365f80cfee0))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([05629cf](https://github.com/brand-dot-dev/python-sdk/commit/05629cf3a6cef8bf5b65aa4df60528e313883a7b))

## 1.5.0 (2025-06-08)

Full Changelog: [v1.4.0...v1.5.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.4.0...v1.5.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Brand Dev Python API library

[![PyPI version](https://img.shields.io/pypi/v/brand.dev.svg)](https://pypi.org/project/brand.dev/)
[![PyPI version](<https://img.shields.io/pypi/v/brand.dev.svg?label=pypi%20(stable)>)](https://pypi.org/project/brand.dev/)

The Brand Dev Python library provides convenient access to the Brand Dev REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -170,7 +170,7 @@ client.with_options(max_retries=5).brand.retrieve(
### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from brand.dev import BrandDev
Expand Down
6 changes: 6 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ from brand.dev.types import (
BrandPrefetchResponse,
BrandRetrieveByTickerResponse,
BrandRetrieveNaicsResponse,
BrandRetrieveSimplifiedResponse,
BrandScreenshotResponse,
BrandSearchResponse,
BrandStyleguideResponse,
)
```

Expand All @@ -22,4 +25,7 @@ Methods:
- <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-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>
- <code title="get /brand/retrieve-simplified">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_simplified</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_simplified_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_simplified_response.py">BrandRetrieveSimplifiedResponse</a></code>
- <code title="get /brand/screenshot">client.brand.<a href="./src/brand/dev/resources/brand.py">screenshot</a>(\*\*<a href="src/brand/dev/types/brand_screenshot_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_screenshot_response.py">BrandScreenshotResponse</a></code>
- <code title="get /brand/search">client.brand.<a href="./src/brand/dev/resources/brand.py">search</a>(\*\*<a href="src/brand/dev/types/brand_search_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_search_response.py">BrandSearchResponse</a></code>
- <code title="get /brand/styleguide">client.brand.<a href="./src/brand/dev/resources/brand.py">styleguide</a>(\*\*<a href="src/brand/dev/types/brand_styleguide_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_styleguide_response.py">BrandStyleguideResponse</a></code>
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "brand.dev"
version = "1.5.0"
version = "1.6.0"
description = "The official Python library for the brand.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -54,6 +54,7 @@ dev-dependencies = [
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

[tool.rye.scripts]
Expand Down Expand Up @@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/brand-dot-dev/python-sdk/tree/main/\g<2>)

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=short"
addopts = "--tb=short -n auto"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
Expand Down
4 changes: 4 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ distro==1.8.0
exceptiongroup==1.2.2
# via anyio
# via pytest
execnet==2.1.1
# via pytest-xdist
filelock==3.12.4
# via virtualenv
h11==0.14.0
Expand Down Expand Up @@ -72,7 +74,9 @@ pygments==2.18.0
pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
# via pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.8.2
# via time-machine
pytz==2023.3.post1
Expand Down
18 changes: 16 additions & 2 deletions src/brand/dev/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,14 @@ def _process_response(
) -> ResponseT:
origin = get_origin(cast_to) or cast_to

if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
if (
inspect.isclass(origin)
and issubclass(origin, BaseAPIResponse)
# we only want to actually return the custom BaseAPIResponse class if we're
# returning the raw response, or if we're not streaming SSE, as if we're streaming
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
):
if not issubclass(origin, APIResponse):
raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")

Expand Down Expand Up @@ -1574,7 +1581,14 @@ async def _process_response(
) -> ResponseT:
origin = get_origin(cast_to) or cast_to

if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
if (
inspect.isclass(origin)
and issubclass(origin, BaseAPIResponse)
# we only want to actually return the custom BaseAPIResponse class if we're
# returning the raw response, or if we're not streaming SSE, as if we're streaming
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
):
if not issubclass(origin, AsyncAPIResponse):
raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")

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.5.0" # x-release-please-version
__version__ = "1.6.0" # x-release-please-version
Loading