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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
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.10.1"
".": "1.11.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: 9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-70f44e886c51bd700af031ad9b5c8f0042ef15fde038ba83ed08f61cd9d05266.yml
openapi_spec_hash: 9b834ba9e373689a8e2fbd8312b1f2de
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a41dc66f0aa3dbc9e8fe1da75f1101cbcb2fac79f728de42e4877cfe1bde3b6e.yml
openapi_spec_hash: 63c1a53e0899fb63a514dad395fd48f9
config_hash: 4b10254ea5b8e26ce632222b94a918aa
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.11.0 (2025-07-31)

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

### Features

* **api:** manual updates ([59f9ac6](https://github.com/brand-dot-dev/python-sdk/commit/59f9ac61748a337bcbec52a0034f06cac9e1b3d9))
* **api:** manual updates ([59002c5](https://github.com/brand-dot-dev/python-sdk/commit/59002c5632848838141179929202e55c3c53d6a9))
* **client:** support file upload requests ([5a700a4](https://github.com/brand-dot-dev/python-sdk/commit/5a700a45169a4bf3e13f7d27fd1eb0698db48b53))


### Chores

* **project:** add settings file for vscode ([5218747](https://github.com/brand-dot-dev/python-sdk/commit/5218747ee50439e600cfb756f14364d9a7e7aef3))

## 1.10.1 (2025-07-23)

Full Changelog: [v1.10.0...v1.10.1](https://github.com/brand-dot-dev/python-sdk/compare/v1.10.0...v1.10.1)
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.10.1"
version = "1.11.0"
description = "The official Python library for the brand.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
5 changes: 4 additions & 1 deletion src/brand/dev/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,10 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"

if is_body_allowed:
kwargs["json"] = json_data if is_given(json_data) else None
if isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
Expand Down
8 changes: 4 additions & 4 deletions src/brand/dev/_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
return file

if is_tuple_t(file):
return (file[0], _read_file_content(file[1]), *file[2:])
return (file[0], read_file_content(file[1]), *file[2:])

raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")


def _read_file_content(file: FileContent) -> HttpxFileContent:
def read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return pathlib.Path(file).read_bytes()
return file
Expand Down Expand Up @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
return file

if is_tuple_t(file):
return (file[0], await _async_read_file_content(file[1]), *file[2:])
return (file[0], await async_read_file_content(file[1]), *file[2:])

raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")


async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
async def async_read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return await anyio.Path(file).read_bytes()

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.10.1" # x-release-please-version
__version__ = "1.11.0" # x-release-please-version
3 changes: 3 additions & 0 deletions src/brand/dev/types/brand_ai_query_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ class BrandAIQueryResponse(BaseModel):
domain: Optional[str] = None
"""The domain that was analyzed"""

status: Optional[str] = None
"""Status of the response, e.g., 'ok'"""

urls_analyzed: Optional[List[str]] = None
"""List of URLs that were analyzed"""
32 changes: 26 additions & 6 deletions src/brand/dev/types/brand_identify_from_transaction_response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from .._models import BaseModel

Expand Down Expand Up @@ -52,6 +53,9 @@ class BrandBackdropColor(BaseModel):


class BrandBackdropResolution(BaseModel):
aspect_ratio: Optional[float] = None
"""Aspect ratio of the image (width/height)"""

height: Optional[int] = None
"""Height of the image in pixels"""

Expand Down Expand Up @@ -87,6 +91,9 @@ class BrandLogoColor(BaseModel):


class BrandLogoResolution(BaseModel):
aspect_ratio: Optional[float] = None
"""Aspect ratio of the image (width/height)"""

height: Optional[int] = None
"""Height of the image in pixels"""

Expand All @@ -98,17 +105,21 @@ class BrandLogo(BaseModel):
colors: Optional[List[BrandLogoColor]] = None
"""Array of colors in the logo"""

group: Optional[int] = None
"""Group identifier for logos"""

mode: Optional[str] = None
"""Mode of the logo, e.g., 'dark', 'light'"""
mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None
"""
Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
best for dark mode, 'has_opaque_background' = can be used for either as image
has its own background
"""

resolution: Optional[BrandLogoResolution] = None
"""Resolution of the logo image"""

type: Optional[Literal["icon", "logo"]] = None
"""Type of the logo based on resolution (e.g., 'icon', 'logo')"""

url: Optional[str] = None
"""URL of the logo image"""
"""CDN hosted url of the logo (ready for display)"""


class BrandSocial(BaseModel):
Expand Down Expand Up @@ -143,9 +154,18 @@ class Brand(BaseModel):
domain: Optional[str] = None
"""The domain name of the brand"""

email: Optional[str] = None
"""Company email address"""

is_nsfw: Optional[bool] = None
"""Indicates whether the brand content is not safe for work (NSFW)"""

logos: Optional[List[BrandLogo]] = None
"""An array of logos associated with the brand"""

phone: Optional[str] = None
"""Company phone number"""

slogan: Optional[str] = None
"""The brand's slogan"""

Expand Down
32 changes: 26 additions & 6 deletions src/brand/dev/types/brand_retrieve_by_ticker_response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from .._models import BaseModel

Expand Down Expand Up @@ -52,6 +53,9 @@ class BrandBackdropColor(BaseModel):


class BrandBackdropResolution(BaseModel):
aspect_ratio: Optional[float] = None
"""Aspect ratio of the image (width/height)"""

height: Optional[int] = None
"""Height of the image in pixels"""

Expand Down Expand Up @@ -87,6 +91,9 @@ class BrandLogoColor(BaseModel):


class BrandLogoResolution(BaseModel):
aspect_ratio: Optional[float] = None
"""Aspect ratio of the image (width/height)"""

height: Optional[int] = None
"""Height of the image in pixels"""

Expand All @@ -98,17 +105,21 @@ class BrandLogo(BaseModel):
colors: Optional[List[BrandLogoColor]] = None
"""Array of colors in the logo"""

group: Optional[int] = None
"""Group identifier for logos"""

mode: Optional[str] = None
"""Mode of the logo, e.g., 'dark', 'light'"""
mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None
"""
Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
best for dark mode, 'has_opaque_background' = can be used for either as image
has its own background
"""

resolution: Optional[BrandLogoResolution] = None
"""Resolution of the logo image"""

type: Optional[Literal["icon", "logo"]] = None
"""Type of the logo based on resolution (e.g., 'icon', 'logo')"""

url: Optional[str] = None
"""URL of the logo image"""
"""CDN hosted url of the logo (ready for display)"""


class BrandSocial(BaseModel):
Expand Down Expand Up @@ -143,9 +154,18 @@ class Brand(BaseModel):
domain: Optional[str] = None
"""The domain name of the brand"""

email: Optional[str] = None
"""Company email address"""

is_nsfw: Optional[bool] = None
"""Indicates whether the brand content is not safe for work (NSFW)"""

logos: Optional[List[BrandLogo]] = None
"""An array of logos associated with the brand"""

phone: Optional[str] = None
"""Company phone number"""

slogan: Optional[str] = None
"""The brand's slogan"""

Expand Down
32 changes: 26 additions & 6 deletions src/brand/dev/types/brand_retrieve_response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from .._models import BaseModel

Expand Down Expand Up @@ -52,6 +53,9 @@ class BrandBackdropColor(BaseModel):


class BrandBackdropResolution(BaseModel):
aspect_ratio: Optional[float] = None
"""Aspect ratio of the image (width/height)"""

height: Optional[int] = None
"""Height of the image in pixels"""

Expand Down Expand Up @@ -87,6 +91,9 @@ class BrandLogoColor(BaseModel):


class BrandLogoResolution(BaseModel):
aspect_ratio: Optional[float] = None
"""Aspect ratio of the image (width/height)"""

height: Optional[int] = None
"""Height of the image in pixels"""

Expand All @@ -98,17 +105,21 @@ class BrandLogo(BaseModel):
colors: Optional[List[BrandLogoColor]] = None
"""Array of colors in the logo"""

group: Optional[int] = None
"""Group identifier for logos"""

mode: Optional[str] = None
"""Mode of the logo, e.g., 'dark', 'light'"""
mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None
"""
Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
best for dark mode, 'has_opaque_background' = can be used for either as image
has its own background
"""

resolution: Optional[BrandLogoResolution] = None
"""Resolution of the logo image"""

type: Optional[Literal["icon", "logo"]] = None
"""Type of the logo based on resolution (e.g., 'icon', 'logo')"""

url: Optional[str] = None
"""URL of the logo image"""
"""CDN hosted url of the logo (ready for display)"""


class BrandSocial(BaseModel):
Expand Down Expand Up @@ -143,9 +154,18 @@ class Brand(BaseModel):
domain: Optional[str] = None
"""The domain name of the brand"""

email: Optional[str] = None
"""Company email address"""

is_nsfw: Optional[bool] = None
"""Indicates whether the brand content is not safe for work (NSFW)"""

logos: Optional[List[BrandLogo]] = None
"""An array of logos associated with the brand"""

phone: Optional[str] = None
"""Company phone number"""

slogan: Optional[str] = None
"""The brand's slogan"""

Expand Down
18 changes: 10 additions & 8 deletions src/brand/dev/types/brand_retrieve_simplified_response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from .._models import BaseModel

Expand Down Expand Up @@ -78,20 +79,21 @@ class BrandLogo(BaseModel):
colors: Optional[List[BrandLogoColor]] = None
"""Array of colors in the logo"""

group: Optional[int] = None
"""Group identifier for logos"""

mode: Optional[str] = None
"""Mode of the logo, e.g., 'dark', 'light'"""
mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None
"""
Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
best for dark mode, 'has_opaque_background' = can be used for either as image
has its own background
"""

resolution: Optional[BrandLogoResolution] = None
"""Resolution of the logo image"""

type: Optional[str] = None
"""Type of the logo based on resolution (e.g., 'icon', 'logo', 'banner')"""
type: Optional[Literal["icon", "logo"]] = None
"""Type of the logo based on resolution (e.g., 'icon', 'logo')"""

url: Optional[str] = None
"""URL of the logo image"""
"""CDN hosted url of the logo (ready for display)"""


class Brand(BaseModel):
Expand Down