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: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/context.dev-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

Expand All @@ -35,7 +35,7 @@ jobs:
run: ./scripts/lint

build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/brand-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml
# You can run this workflow by navigating to https://www.github.com/context-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'brand-dot-dev/context-python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
if: github.repository == 'context-dot-dev/context-python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
_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 @@
{
".": "0.2.1"
".": "0.4.0"
}
6 changes: 3 additions & 3 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/context-dev%2Fcontext.dev-c2e94e0c758b1aaba120c2a4231842fff0a120acc471fe24c7a81221e13a0482.yml
openapi_spec_hash: aabc231b46b1ca3375882f96c378c665
config_hash: ab5135cc119f83ae2821f9445ed99d16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml
openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14
config_hash: 38268bb88fc4dcbb8f2f94dd138b5910
191 changes: 188 additions & 3 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
$ pip install git+ssh://git@github.com/brand-dot-dev/context-python-sdk.git
$ pip install git+ssh://git@github.com/context-dot-dev/context-python-sdk.git
```

Alternatively, you can build from source and install the wheel file:
Expand Down Expand Up @@ -113,7 +113,7 @@ the changes aren't made through the automated pipeline, you may want to make rel

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/brand-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/context-dot-dev/context-python-sdk/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ brand = response.parse() # get the object that `brand.retrieve()` would have re
print(brand.brand)
```

These methods return an [`APIResponse`](https://github.com/brand-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object.
These methods return an [`APIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/brand-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
The async client returns an [`AsyncAPIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand Down Expand Up @@ -391,7 +391,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/brand-dot-dev/context-python-sdk/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/context-dot-dev/context-python-sdk/issues) with questions, bugs, or suggestions.

### Determining the installed version

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "context.dev"
version = "0.2.1"
version = "0.4.0"
description = "The official Python library for the context.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -37,8 +37,8 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/brand-dot-dev/context-python-sdk"
Repository = "https://github.com/brand-dot-dev/context-python-sdk"
Homepage = "https://github.com/context-dot-dev/context-python-sdk"
Repository = "https://github.com/context-dot-dev/context-python-sdk"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
Expand Down Expand Up @@ -112,7 +112,7 @@ path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# replace relative links with absolute links
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/brand-dot-dev/context-python-sdk/tree/main/\g<2>)'
replacement = '[\1](https://github.com/context-dot-dev/context-python-sdk/tree/main/\g<2>)'

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
5 changes: 4 additions & 1 deletion src/context/dev/_qs.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def _stringify_item(
items.extend(self._stringify_item(key, item, opts))
return items
elif array_format == "indices":
raise NotImplementedError("The array indices format is not supported yet")
items = []
for i, item in enumerate(value):
items.extend(self._stringify_item(f"{key}[{i}]", item, opts))
return items
elif array_format == "brackets":
items = []
key = key + "[]"
Expand Down
2 changes: 1 addition & 1 deletion src/context/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__ = "context.dev"
__version__ = "0.2.1" # x-release-please-version
__version__ = "0.4.0" # x-release-please-version
16 changes: 8 additions & 8 deletions src/context/dev/resources/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def with_raw_response(self) -> AIResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return AIResourceWithRawResponse(self)

Expand All @@ -42,7 +42,7 @@ def with_streaming_response(self) -> AIResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return AIResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -164,7 +164,7 @@ def extract_products(
) -> AIExtractProductsResponse:
"""Beta feature: Extract product information from a brand's website.

Brand.dev will
We will
analyze the website and return a list of products with details such as name,
description, image, pricing, features, and more.

Expand Down Expand Up @@ -202,7 +202,7 @@ def extract_products(
) -> AIExtractProductsResponse:
"""Beta feature: Extract product information from a brand's website.

Brand.dev will
We will
analyze the website and return a list of products with details such as name,
description, image, pricing, features, and more.

Expand Down Expand Up @@ -265,7 +265,7 @@ def with_raw_response(self) -> AsyncAIResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncAIResourceWithRawResponse(self)

Expand All @@ -274,7 +274,7 @@ def with_streaming_response(self) -> AsyncAIResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return AsyncAIResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -396,7 +396,7 @@ async def extract_products(
) -> AIExtractProductsResponse:
"""Beta feature: Extract product information from a brand's website.

Brand.dev will
We will
analyze the website and return a list of products with details such as name,
description, image, pricing, features, and more.

Expand Down Expand Up @@ -434,7 +434,7 @@ async def extract_products(
) -> AIExtractProductsResponse:
"""Beta feature: Extract product information from a brand's website.

Brand.dev will
We will
analyze the website and return a list of products with details such as name,
description, image, pricing, features, and more.

Expand Down
8 changes: 4 additions & 4 deletions src/context/dev/resources/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def with_raw_response(self) -> BrandResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return BrandResourceWithRawResponse(self)

Expand All @@ -53,7 +53,7 @@ def with_streaming_response(self) -> BrandResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return BrandResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -1413,7 +1413,7 @@ def with_raw_response(self) -> AsyncBrandResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncBrandResourceWithRawResponse(self)

Expand All @@ -1422,7 +1422,7 @@ def with_streaming_response(self) -> AsyncBrandResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return AsyncBrandResourceWithStreamingResponse(self)

Expand Down
8 changes: 4 additions & 4 deletions src/context/dev/resources/industry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def with_raw_response(self) -> IndustryResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return IndustryResourceWithRawResponse(self)

Expand All @@ -37,7 +37,7 @@ def with_streaming_response(self) -> IndustryResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return IndustryResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -108,7 +108,7 @@ def with_raw_response(self) -> AsyncIndustryResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncIndustryResourceWithRawResponse(self)

Expand All @@ -117,7 +117,7 @@ def with_streaming_response(self) -> AsyncIndustryResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return AsyncIndustryResourceWithStreamingResponse(self)

Expand Down
8 changes: 4 additions & 4 deletions src/context/dev/resources/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def with_raw_response(self) -> StyleResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return StyleResourceWithRawResponse(self)

Expand All @@ -40,7 +40,7 @@ def with_streaming_response(self) -> StyleResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return StyleResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -166,7 +166,7 @@ def with_raw_response(self) -> AsyncStyleResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncStyleResourceWithRawResponse(self)

Expand All @@ -175,7 +175,7 @@ def with_streaming_response(self) -> AsyncStyleResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return AsyncStyleResourceWithStreamingResponse(self)

Expand Down
8 changes: 4 additions & 4 deletions src/context/dev/resources/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def with_raw_response(self) -> UtilityResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return UtilityResourceWithRawResponse(self)

Expand All @@ -38,7 +38,7 @@ def with_streaming_response(self) -> UtilityResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return UtilityResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -150,7 +150,7 @@ def with_raw_response(self) -> AsyncUtilityResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncUtilityResourceWithRawResponse(self)

Expand All @@ -159,7 +159,7 @@ def with_streaming_response(self) -> AsyncUtilityResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/brand-dot-dev/context-python-sdk#with_streaming_response
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
"""
return AsyncUtilityResourceWithStreamingResponse(self)

Expand Down
Loading
Loading