Skip to content

Commit

Permalink
Merge pull request #8 from clear-street/release-please--branches--mai…
Browse files Browse the repository at this point in the history
…n--changes--next

release: 0.1.0-alpha.3
  • Loading branch information
sachnk authored Jul 10, 2024
2 parents 381cd46 + 0e9e7c5 commit 55dc323
Show file tree
Hide file tree
Showing 125 changed files with 444 additions and 423 deletions.
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.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.1.0-alpha.3 (2024-07-10)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/clear-street/studio-sdk-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

### Features

* **api:** update via SDK Studio ([#10](https://github.com/clear-street/studio-sdk-python/issues/10)) ([284ea5b](https://github.com/clear-street/studio-sdk-python/commit/284ea5b1cae0af30bcd78cdc0048d3ec655312f7))
* **api:** update via SDK Studio ([#11](https://github.com/clear-street/studio-sdk-python/issues/11)) ([796f671](https://github.com/clear-street/studio-sdk-python/commit/796f671499be4027923046db555c1119a4fa1b30))
* **api:** update via SDK Studio ([#12](https://github.com/clear-street/studio-sdk-python/issues/12)) ([4f42bdc](https://github.com/clear-street/studio-sdk-python/commit/4f42bdc10992f6158c865781a0bdc70ae79b58e4))
* **api:** update via SDK Studio ([#13](https://github.com/clear-street/studio-sdk-python/issues/13)) ([6a92603](https://github.com/clear-street/studio-sdk-python/commit/6a926036a955e0d5ce12a3b1ee7a01ca88698a20))
* **api:** update via SDK Studio ([#14](https://github.com/clear-street/studio-sdk-python/issues/14)) ([181db49](https://github.com/clear-street/studio-sdk-python/commit/181db499eb8ba91afbf899bd2900d9893c4a941e))
* **api:** update via SDK Studio ([#15](https://github.com/clear-street/studio-sdk-python/issues/15)) ([db742cc](https://github.com/clear-street/studio-sdk-python/commit/db742cc51159f5c9838c4695c84ed38d8f9df665))
* **api:** update via SDK Studio ([#16](https://github.com/clear-street/studio-sdk-python/issues/16)) ([ca129f2](https://github.com/clear-street/studio-sdk-python/commit/ca129f2406b8e307a0f9c866d3433f901252bdfd))
* **api:** update via SDK Studio ([#7](https://github.com/clear-street/studio-sdk-python/issues/7)) ([540756e](https://github.com/clear-street/studio-sdk-python/commit/540756eb7ce95eb3404ae9873ccfc310b1f52cac))
* **api:** update via SDK Studio ([#9](https://github.com/clear-street/studio-sdk-python/issues/9)) ([5f6f844](https://github.com/clear-street/studio-sdk-python/commit/5f6f844097eeb52a6dad6a8e22676a4f84848c02))

## 0.1.0-alpha.2 (2024-07-09)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/clear-street/studio-sdk-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock
## Modifying/Adding code

Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
`src/studio_minus_sdk/lib/` and `examples/` directories are exceptions and will never be overridden.
`src/studio_sdk/lib/` and `examples/` directories are exceptions and will never be overridden.

## Adding and running examples

Expand Down
53 changes: 25 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,21 @@ The REST API documentation can be found [on docs.clearstreet.io](https://docs.cl
## Installation

```sh
# install from the production repo
pip install git+ssh://[email protected]/clear-street/studio-sdk-python.git
# install from PyPI
pip install --pre studio-sdk
```

> [!NOTE]
> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre studio-sdk`
## Usage

The full API of this library can be found in [api.md](api.md).

```python
from studio_minus_sdk import StudioSDK
from studio_sdk import StudioSDK

client = StudioSDK()

entity = client.entities.retrieve(
"REPLACE_ME",
"<your entity_id>",
)
print(entity.entity_id)
```
Expand All @@ -48,14 +45,14 @@ Simply import `AsyncStudioSDK` instead of `StudioSDK` and use `await` with each

```python
import asyncio
from studio_minus_sdk import AsyncStudioSDK
from studio_sdk import AsyncStudioSDK

client = AsyncStudioSDK()


async def main() -> None:
entity = await client.entities.retrieve(
"REPLACE_ME",
"<your entity_id>",
)
print(entity.entity_id)

Expand All @@ -76,29 +73,29 @@ Typed requests and responses provide autocomplete and documentation within your

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `studio_minus_sdk.APIConnectionError` is raised.
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `studio_sdk.APIConnectionError` is raised.

When the API returns a non-success status code (that is, 4xx or 5xx
response), a subclass of `studio_minus_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
response), a subclass of `studio_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

All errors inherit from `studio_minus_sdk.APIError`.
All errors inherit from `studio_sdk.APIError`.

```python
import studio_minus_sdk
from studio_minus_sdk import StudioSDK
import studio_sdk
from studio_sdk import StudioSDK

client = StudioSDK()

try:
client.entities.retrieve(
"REPLACE_ME",
"<your entity_id>",
)
except studio_minus_sdk.APIConnectionError as e:
except studio_sdk.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
except studio_minus_sdk.RateLimitError as e:
except studio_sdk.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
except studio_minus_sdk.APIStatusError as e:
except studio_sdk.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
Expand Down Expand Up @@ -126,7 +123,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
You can use the `max_retries` option to configure or disable retry settings:

```python
from studio_minus_sdk import StudioSDK
from studio_sdk import StudioSDK

# Configure the default for all requests:
client = StudioSDK(
Expand All @@ -136,7 +133,7 @@ client = StudioSDK(

# Or, configure per-request:
client.with_options(max_retries=5).entities.retrieve(
"REPLACE_ME",
"<your entity_id>",
)
```

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

```python
from studio_minus_sdk import StudioSDK
from studio_sdk import StudioSDK

# Configure the default for all requests:
client = StudioSDK(
Expand All @@ -161,7 +158,7 @@ client = StudioSDK(

# Override per-request:
client.with_options(timeout=5.0).entities.retrieve(
"REPLACE_ME",
"<your entity_id>",
)
```

Expand Down Expand Up @@ -198,21 +195,21 @@ if response.my_field is None:
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

```py
from studio_minus_sdk import StudioSDK
from studio_sdk import StudioSDK

client = StudioSDK()
response = client.entities.with_raw_response.retrieve(
"REPLACE_ME",
"<your entity_id>",
)
print(response.headers.get('X-My-Header'))

entity = response.parse() # get the object that `entities.retrieve()` would have returned
print(entity.entity_id)
```

These methods return an [`APIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_minus_sdk/_response.py) object.
These methods return an [`APIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_sdk/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_minus_sdk/_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/clear-street/studio-sdk-python/tree/main/src/studio_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand All @@ -222,7 +219,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.entities.with_streaming_response.retrieve(
"REPLACE_ME",
"<your entity_id>",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down Expand Up @@ -276,7 +273,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

```python
from studio_minus_sdk import StudioSDK, DefaultHttpxClient
from studio_sdk import StudioSDK, DefaultHttpxClient

client = StudioSDK(
# Or use the `STUDIO_SDK_BASE_URL` env var
Expand Down
Loading

0 comments on commit 55dc323

Please sign in to comment.