Skip to content
Open
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: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env.local
**/__pycache__/
**/.speakeasy/temp/
**/.speakeasy/logs/
Expand Down
24 changes: 14 additions & 10 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 8b5fa338-9106-4734-abf0-e30d67044a90
management:
docChecksum: 8038a5b9e376d44bad2fd4c117922954
docVersion: 1.1.45
speakeasyVersion: 1.601.0
generationVersion: 2.680.0
releaseVersion: 0.42.3
configChecksum: 3d02dd7ca437781b3d721fab5d7b9adc
docChecksum: d2d0852108e5c7d29e4de1d909c8b1a0
docVersion: 1.1.68
speakeasyVersion: 1.636.2
generationVersion: 2.723.8
releaseVersion: 0.43.0
configChecksum: 3206d0895f6828ba4725a39559160d14
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
repoSubDirectory: .
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
Expand All @@ -16,13 +16,13 @@ features:
acceptHeaders: 3.0.0
additionalDependencies: 1.0.0
constsAndDefaults: 1.0.5
core: 5.19.8
core: 5.22.1
customCodeRegions: 0.1.1
defaultEnabledRetries: 0.2.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.3.2
examples: 3.0.2
globalSecurity: 3.0.3
globalSecurity: 3.0.4
globalSecurityCallbacks: 1.0.0
globalSecurityFlattening: 1.0.0
globalServerURLs: 3.1.1
Expand All @@ -34,7 +34,7 @@ features:
retries: 3.0.2
sdkHooks: 1.1.0
serverIDs: 3.0.0
unions: 3.0.4
unions: 3.1.0
uploadStreams: 1.0.0
generatedFiles:
- .gitattributes
Expand Down Expand Up @@ -101,6 +101,8 @@ generatedFiles:
- docs/models/shared/astradbconnectorconfiginput.md
- docs/models/shared/azureaisearchconnectorconfig.md
- docs/models/shared/azureaisearchconnectorconfiginput.md
- docs/models/shared/azuredestinationconnectorconfig.md
- docs/models/shared/azuredestinationconnectorconfiginput.md
- docs/models/shared/azuresourceconnectorconfig.md
- docs/models/shared/azuresourceconnectorconfiginput.md
- docs/models/shared/bodyrunworkflow.md
Expand Down Expand Up @@ -229,7 +231,6 @@ generatedFiles:
- docs/sdks/general/README.md
- docs/sdks/jobs/README.md
- docs/sdks/sources/README.md
- docs/sdks/unstructuredclient/README.md
- docs/sdks/workflows/README.md
- poetry.toml
- py.typed
Expand Down Expand Up @@ -287,6 +288,8 @@ generatedFiles:
- src/unstructured_client/models/shared/astradbconnectorconfiginput.py
- src/unstructured_client/models/shared/azureaisearchconnectorconfig.py
- src/unstructured_client/models/shared/azureaisearchconnectorconfiginput.py
- src/unstructured_client/models/shared/azuredestinationconnectorconfig.py
- src/unstructured_client/models/shared/azuredestinationconnectorconfiginput.py
- src/unstructured_client/models/shared/azuresourceconnectorconfig.py
- src/unstructured_client/models/shared/azuresourceconnectorconfiginput.py
- src/unstructured_client/models/shared/body_run_workflow.py
Expand Down Expand Up @@ -712,3 +715,4 @@ examples:
application/json: {"detail": []}
examplesVersion: 1.0.2
generatedTests: {}
releaseNotes: "## Python SDK Changes Detected:\n* `unstructured_client.destinations.create_destination()`: \n * `request.create_destination_connector.config.[azure_destination_connector_config_input]` **Added**\n * `response.config.[azure_destination_connector_config]` **Added**\n* `unstructured_client.destinations.get_destination()`: `response.config.[azure_destination_connector_config]` **Added**\n* `unstructured_client.destinations.list_destinations()`: \n * `request.destination_type` **Changed**\n * `response.[].config.[azure_destination_connector_config]` **Added**\n* `unstructured_client.destinations.update_destination()`: \n * `request.update_destination_connector.config.[azure_destination_connector_config_input]` **Added**\n * `response.config.[azure_destination_connector_config]` **Added**\n"
16 changes: 8 additions & 8 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.601.0
speakeasyVersion: 1.636.2
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:8165f715321cd34bcebb6c9bb0734a1791777229937787b8e13707d519b05a5e
sourceBlobDigest: sha256:b4f8d9a6b0f4245c50b5e53298343df470978417248fa3988aeeb84ec9200c93
sourceRevisionDigest: sha256:01b07e09a6d707c217eea8611647c0d22d909d8e94115821cf0595f81f761d73
sourceBlobDigest: sha256:a48895f01783a1620d65552d007ff46e4dc2652b37c64dfd8aab3163317e801b
tags:
- latest
- speakeasy-sdk-regen-1754698272
- 1.1.45
- speakeasy-sdk-regen-1756339855
- 1.1.68
targets:
unstructured-python:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:8165f715321cd34bcebb6c9bb0734a1791777229937787b8e13707d519b05a5e
sourceBlobDigest: sha256:b4f8d9a6b0f4245c50b5e53298343df470978417248fa3988aeeb84ec9200c93
sourceRevisionDigest: sha256:01b07e09a6d707c217eea8611647c0d22d909d8e94115821cf0595f81f761d73
sourceBlobDigest: sha256:a48895f01783a1620d65552d007ff46e4dc2652b37c64dfd8aab3163317e801b
codeSamplesNamespace: my-source-code-samples
codeSamplesRevisionDigest: sha256:a5e11972bfb15e43b7fcb2647b3a7b3e129e9303294f9110670280971b10780a
codeSamplesRevisionDigest: sha256:54f08520c48e4b706c8ffa67fd8c59940bad24add35b7159dea7f73042ff0e44
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ with UnstructuredClient() as uc_client:
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1119,4 +1119,14 @@ Based on:
### Generated
- [python v0.42.3] .
### Releases
- [PyPI v0.42.3] https://pypi.org/project/unstructured-client/0.42.3 - .
- [PyPI v0.42.3] https://pypi.org/project/unstructured-client/0.42.3 - .

## 2025-10-09 00:09:58
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.636.2 (2.723.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.43.0] .
### Releases
- [PyPI v0.43.0] https://pypi.org/project/unstructured-client/0.43.0 - .
1 change: 1 addition & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ with UnstructuredClient() as uc_client:
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down
4 changes: 2 additions & 2 deletions codeSamples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ actions:
"x-codeSamples":
- "lang": "python"
"label": "create_destination"
"source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.create_destination(request={\n \"create_destination_connector\": {\n \"name\": \"<value>\",\n \"type\": shared.DestinationConnectorType.MOTHERDUCK,\n \"config\": {\n \"index_name\": \"<value>\",\n \"api_key\": \"<value>\",\n \"namespace\": \"<value>\",\n \"batch_size\": 50,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)"
"source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.create_destination(request={\n \"create_destination_connector\": {\n \"name\": \"<value>\",\n \"type\": shared.DestinationConnectorType.MONGODB,\n \"config\": {\n \"index_name\": \"<value>\",\n \"api_key\": \"<value>\",\n \"namespace\": \"<value>\",\n \"batch_size\": 50,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)"
- target: $["paths"]["/api/v1/destinations/{destination_id}"]["delete"]
update:
"x-codeSamples":
Expand All @@ -32,7 +32,7 @@ actions:
"x-codeSamples":
- "lang": "python"
"label": "update_destination"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.update_destination(request={\n \"destination_id\": \"9726962d-9d1e-4f84-8787-c7313d183927\",\n \"update_destination_connector\": {\n \"config\": {\n \"bootstrap_servers\": \"<value>\",\n \"port\": 9092,\n \"topic\": \"<value>\",\n \"kafka_api_key\": \"<value>\",\n \"secret\": \"<value>\",\n \"batch_size\": 100,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.update_destination(request={\n \"destination_id\": \"962d9d1e-f847-487c-a731-3d18392716fb\",\n \"update_destination_connector\": {\n \"config\": {\n \"remote_url\": \"https://lined-clamp.info\",\n \"service_account_key\": \"<value>\",\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)"
- target: $["paths"]["/api/v1/destinations/{destination_id}/connection-check"]["get"]
update:
"x-codeSamples":
Expand Down
6 changes: 6 additions & 0 deletions docs/models/shared/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

## Supported Types

### `shared.AzureDestinationConnectorConfigInput`

```python
value: shared.AzureDestinationConnectorConfigInput = /* values here */
```

### `shared.AstraDBConnectorConfigInput`

```python
Expand Down
6 changes: 6 additions & 0 deletions docs/models/shared/destinationconnectorinformationconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

## Supported Types

### `shared.AzureDestinationConnectorConfig`

```python
value: shared.AzureDestinationConnectorConfig = /* values here */
```

### `shared.AstraDBConnectorConfig`

```python
Expand Down
1 change: 1 addition & 0 deletions docs/models/shared/destinationconnectortype.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

| Name | Value |
| -------------------------------- | -------------------------------- |
| `AZURE` | azure |
| `ASTRADB` | astradb |
| `AZURE_AI_SEARCH` | azure_ai_search |
| `COUCHBASE` | couchbase |
Expand Down
6 changes: 6 additions & 0 deletions docs/models/shared/updatedestinationconnectorconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

## Supported Types

### `shared.AzureDestinationConnectorConfigInput`

```python
value: shared.AzureDestinationConnectorConfigInput = /* values here */
```

### `shared.AstraDBConnectorConfigInput`

```python
Expand Down
5 changes: 0 additions & 5 deletions docs/sdks/unstructuredclient/README.md

This file was deleted.

9 changes: 8 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
hoistGlobalSecurity: true
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 0.42.3
version: 0.43.0
additionalDependencies:
dev:
deepdiff: '>=6.0'
Expand All @@ -36,6 +37,10 @@ python:
httpx: '>=0.27.0'
pypdf: '>=4.0'
requests-toolbelt: '>=1.0.0'
allowedRedefinedBuiltins:
- id
- object
asyncMode: both
authors:
- Unstructured
baseErrorName: UnstructuredClientError
Expand All @@ -58,6 +63,7 @@ python:
shared: models/shared
webhooks: models/webhooks
inputModelSuffix: input
legacyPyright: true
license: MIT
maxMethodParams: 0
methodArguments: require-security-and-request
Expand All @@ -69,4 +75,5 @@ python:
pytestFilterWarnings: []
pytestTimeout: 0
responseFormat: envelope
sseFlatResponse: false
templateVersion: v2
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "unstructured-client"
version = "0.42.3"
version = "0.43.0"
description = "Python Client SDK for Unstructured API"
authors = [{ name = "Unstructured" },]
readme = "README-PYPI.md"
Expand Down
5 changes: 5 additions & 0 deletions scripts/prepare_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
GITHUB_URL = (
GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL
)
REPO_SUBDIR = "."
# Ensure the subdirectory has a trailing slash
if not REPO_SUBDIR.endswith("/"):
REPO_SUBDIR += "/"
# links on PyPI should have absolute URLs
readme_contents = re.sub(
r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))",
lambda m: m.group(1)
+ GITHUB_URL
+ "/blob/master/"
+ REPO_SUBDIR
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Malformed GitHub URLs in README Script

The prepare_readme.py script generates malformed GitHub URLs by including an unnecessary ./ segment. This occurs because REPO_SUBDIR is set to . and then a trailing slash is added, leading to ./ being appended to all links, even when the repository subdirectory is the root.

Fix in CursorΒ Fix in Web

+ m.group(2)
+ m.group(3),
readme_contents,
Expand Down
8 changes: 4 additions & 4 deletions src/unstructured_client/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "unstructured-client"
__version__: str = "0.42.3"
__openapi_doc_version__: str = "1.1.45"
__gen_version__: str = "2.680.0"
__user_agent__: str = "speakeasy-sdk/python 0.42.3 2.680.0 1.1.45 unstructured-client"
__version__: str = "0.43.0"
__openapi_doc_version__: str = "1.1.68"
__gen_version__: str = "2.723.8"
__user_agent__: str = "speakeasy-sdk/python 0.43.0 2.723.8 1.1.68 unstructured-client"

try:
if __package__ is not None:
Expand Down
12 changes: 11 additions & 1 deletion src/unstructured_client/basesdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,19 @@

class BaseSDK:
sdk_configuration: SDKConfiguration
parent_ref: Optional[object] = None
"""
Reference to the root SDK instance, if any. This will prevent it from
being garbage collected while there are active streams.
"""

def __init__(self, sdk_config: SDKConfiguration) -> None:
def __init__(
self,
sdk_config: SDKConfiguration,
parent_ref: Optional[object] = None,
) -> None:
self.sdk_configuration = sdk_config
self.parent_ref = parent_ref

def _get_url(self, base_url, url_variables):
sdk_url, sdk_variables = self.sdk_configuration.get_server_details()
Expand Down
Loading