Skip to content

Commit 4ac3b2d

Browse files
github-actions[bot]speakeasybotawalker4
authored
chore: 🐝 Update SDK - Generate 0.26.0-beta.1 (#174)
> [!IMPORTANT] > Linting report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/linting-report/bf0427c20713a11fe7668763b568f89f> > OpenAPI Change report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/changes-report/31a7e970642e0a5917f23d6db791d459> # SDK update Based on: - OpenAPI Doc - Speakeasy CLI 1.396.6 (2.415.6) https://github.com/speakeasy-api/speakeasy ## OpenAPI Change Summary ``` ├─┬Info │ └──[🔀] version (4:14) ├─┬Components │ └─┬partition_parameters │ ├──[➕] properties (275:17) │ └─┬strategy │ ├──[🔀] description (193:34) │ └──[🔀] default (194:30)❌ └─┬Extensions └──[🔀] x-speakeasy-retries (330:22) ``` | Document Element | Total Changes | Breaking Changes | |------------------|---------------|------------------| | info | 1 | 0 | | components | 3 | 1 | ## PYTHON CHANGELOG ## retries: 3.0.2 - 2024-09-06 ### 🐛 Bug Fixes - typing and usage snippets for next pagination func *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## retries: 3.0.1 - 2024-09-06 ### 🐛 Bug Fixes - retries not using asycnio.sleep in async calls *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## constsAndDefaults: 1.0.2 - 2024-08-06 ### 🐛 Bug Fixes - fixed rendering of const fields with examples in usage snippets *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## constsAndDefaults: 1.0.1 - 2024-07-30 ### 🐛 Bug Fixes - fixed handling of consts in non-json usages *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.5.3 - 2024-09-12 ### 🐛 Bug Fixes - crash when there was no available security *(commit by [@ThomasRooney](https://github.com/ThomasRooney))* ## core: 5.5.2 - 2024-09-11 ### 🔧 Chores - improvements to usage snippet generation *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.5.1 - 2024-09-10 ### 🔧 Chores - sort sub-sdks in readme *(commit by [@ThomasRooney](https://github.com/ThomasRooney))* ## core: 5.5.0 - 2024-09-08 ### 🐝 New Features - format code with dprint *(commit by [@disintegrator](https://github.com/disintegrator))* ## core: 5.4.5 - 2024-09-07 ### 🐛 Bug Fixes - ensure async client is used for async request building *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.4.4 - 2024-09-06 ### 🔧 Chores - upgrade to Pydantic 2.9 *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.4.3 - 2024-09-05 ### 🐛 Bug Fixes - ensure generated examples are stable generation to generation *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.4.2 - 2024-08-28 ### 🐛 Bug Fixes - remove pyright entry from pyproject.toml *(commit by [@disintegrator](https://github.com/disintegrator))* ## core: 5.3.9 - 2024-08-18 ### 🐛 Bug Fixes - fixed handling of unset values when using serializers *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.4.1 - 2024-08-17 ### 🔧 Chores - remove unused method param *(commit by [@adaam2](https://github.com/adaam2))* ## core: 5.3.8 - 2024-08-12 ### 🐛 Bug Fixes - downgrade python-dateutil to 2.8.2 *(commit by [@disintegrator](https://github.com/disintegrator))* ## core: 5.4.0 - 2024-08-09 ### 🐝 New Features - default debug logging *(commit by [@ryan-timothy-albert](https://github.com/ryan-timothy-albert))* ## core: 5.3.7 - 2024-08-08 ### 🔧 Chores - add README information regarding IDE support *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.3.6 - 2024-08-08 ### 🐛 Bug Fixes - ensure README uploaded to pypi used absolute links *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.3.5 - 2024-08-07 ### 🐛 Bug Fixes - ordering of models in file to ensure dependencies come first *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.3.4 - 2024-08-06 ### 🐛 Bug Fixes - various fixes to linting and type errors *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.3.3 - 2024-08-02 ### 🐛 Bug Fixes - fixed various issues with pyright warning/errors *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 5.3.2 - 2024-08-01 ### 🐛 Bug Fixes - language specific env var wrapping *(commit by [@ThomasRooney](https://github.com/ThomasRooney))* ## core: 5.3.1 - 2024-08-01 ### 🔧 Chores - set pyproject.toml version field at compile time *(commit by [@disintegrator](https://github.com/disintegrator))* ## core: 5.2.6 - 2024-08-01 ### 🐛 Bug Fixes - add --skip-existing to poetry publish script *(commit by [@disintegrator](https://github.com/disintegrator))* ## core: 5.3.0 - 2024-07-31 ### 🐝 New Features - python debug logger interface *(commit by [@ryan-timothy-albert](https://github.com/ryan-timothy-albert))* ## core: 5.2.5 - 2024-07-31 ### 🐛 Bug Fixes - fixed conversion of collection fields from TypedDict to Pydantic model *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## envVarSecurityUsage: 0.3.1 - 2024-08-03 ### 🐛 Bug Fixes - optionality of security in regards to env var usage *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## envVarSecurityUsage: 0.3.0 - 2024-08-01 ### 🐝 New Features - update security env vars for complex usage *(commit by [@ryan-timothy-albert](https://github.com/ryan-timothy-albert))* ## envVarSecurityUsage: 0.2.1 - 2024-07-27 ### 🐛 Bug Fixes - show username environment variable in usage snippets *(commit by [@disintegrator](https://github.com/disintegrator))* ## globalSecurity: 3.0.2 - 2024-08-07 ### 🐛 Bug Fixes - fixed documentation of global security schemes *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## globalSecurity: 3.0.1 - 2024-08-05 ### 🐛 Bug Fixes - fixed rendering of usage snippets when required security is used with env vars *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## unions: 3.0.2 - 2024-08-09 ### 🐛 Bug Fixes - improved type matching for examples *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* --------- Co-authored-by: speakeasybot <[email protected]> Co-authored-by: Austin Walker <[email protected]>
1 parent 6b81735 commit 4ac3b2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4055
-451
lines changed

Diff for: .github/workflows/ci.yaml

+11-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ permissions:
1212
id-token: write
1313
contents: read
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
test_unit:
1721
strategy:
@@ -25,20 +29,20 @@ jobs:
2529
with:
2630
python-version: ${{ matrix.python-version }}
2731
- name: Install dependencies
28-
run: make install-test
32+
run: make install
2933
- name: Run unit tests
3034
run: |
31-
pip install .
32-
make test-unit
35+
poetry run make test-unit
3336
3437
lint:
3538
runs-on: ubuntu-latest
3639
steps:
3740
- uses: actions/checkout@v4
3841
- name: Install dependencies
39-
run: pip install . && make install-dev
42+
run: make install
4043
- name: Lint
41-
run: make lint
44+
run: |
45+
poetry run make lint
4246
4347
test_integration:
4448
strategy:
@@ -52,11 +56,10 @@ jobs:
5256
with:
5357
python-version: ${{ matrix.python-version }}
5458
- name: Install dependencies
55-
run: make install-test
59+
run: make install
5660
- name: Run all tests
5761
run: |
58-
pip install .
59-
make test
62+
poetry run make test
6063
env:
6164
UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }}
6265

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.venv/
2+
README-PYPI.md
13
pyrightconfig.json
24
venv/
35
src/*.egg-info/

Diff for: .speakeasy/gen.lock

+61-44
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
lockVersion: 2.0.0
22
id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
4-
docChecksum: a6ff17ff485bb4b5884d75af244e18a1
5-
docVersion: 1.0.44
6-
speakeasyVersion: 1.346.0
7-
generationVersion: 2.379.3
8-
releaseVersion: 0.26.0-beta
9-
configChecksum: 96c9dbe127b795111b840819ebcc996d
4+
docChecksum: ad32e3faae264ab1eb7cf461e373dcfa
5+
docVersion: 1.0.48
6+
speakeasyVersion: 1.396.6
7+
generationVersion: 2.415.6
8+
releaseVersion: 0.26.0-beta.1
9+
configChecksum: 1af6154f17e397a8f89b4f6fd727be8d
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1313
published: true
1414
features:
1515
python:
1616
additionalDependencies: 1.0.0
17-
constsAndDefaults: 1.0.0
18-
core: 5.2.4
17+
constsAndDefaults: 1.0.2
18+
core: 5.5.3
1919
defaultEnabledRetries: 0.2.0
20-
envVarSecurityUsage: 0.2.0
20+
enumUnions: 0.1.0
21+
envVarSecurityUsage: 0.3.1
2122
examples: 3.0.0
22-
globalSecurity: 3.0.0
23+
globalSecurity: 3.0.2
2324
globalSecurityCallbacks: 1.0.0
2425
globalSecurityFlattening: 1.0.0
2526
globalServerURLs: 3.0.0
@@ -28,24 +29,56 @@ features:
2829
nullables: 1.0.0
2930
openEnums: 1.0.0
3031
responseFormat: 1.0.0
31-
retries: 3.0.0
32+
retries: 3.0.2
3233
sdkHooks: 1.0.0
3334
serverIDs: 3.0.0
34-
unions: 3.0.1
35+
unions: 3.0.2
3536
uploadStreams: 1.0.0
3637
generatedFiles:
37-
- src/unstructured_client/sdkconfiguration.py
38-
- src/unstructured_client/general.py
39-
- src/unstructured_client/sdk.py
38+
- .gitattributes
4039
- .vscode/settings.json
40+
- CONTRIBUTING.md
41+
- USAGE.md
42+
- docs/models/errors/detail.md
43+
- docs/models/errors/httpvalidationerror.md
44+
- docs/models/errors/servererror.md
45+
- docs/models/operations/partitionrequest.md
46+
- docs/models/operations/partitionresponse.md
47+
- docs/models/shared/chunkingstrategy.md
48+
- docs/models/shared/files.md
49+
- docs/models/shared/loc.md
50+
- docs/models/shared/outputformat.md
51+
- docs/models/shared/partitionparameters.md
52+
- docs/models/shared/security.md
53+
- docs/models/shared/strategy.md
54+
- docs/models/shared/validationerror.md
55+
- poetry.toml
4156
- py.typed
4257
- pylintrc
4358
- pyproject.toml
59+
- scripts/compile.sh
60+
- scripts/prepare-readme.py
4461
- scripts/publish.sh
4562
- src/unstructured_client/__init__.py
63+
- src/unstructured_client/_hooks/__init__.py
64+
- src/unstructured_client/_hooks/sdkhooks.py
65+
- src/unstructured_client/_hooks/types.py
4666
- src/unstructured_client/basesdk.py
67+
- src/unstructured_client/general.py
4768
- src/unstructured_client/httpclient.py
69+
- src/unstructured_client/models/errors/__init__.py
70+
- src/unstructured_client/models/errors/httpvalidationerror.py
71+
- src/unstructured_client/models/errors/sdkerror.py
72+
- src/unstructured_client/models/errors/servererror.py
73+
- src/unstructured_client/models/operations/__init__.py
74+
- src/unstructured_client/models/operations/partition.py
75+
- src/unstructured_client/models/shared/__init__.py
76+
- src/unstructured_client/models/shared/partition_parameters.py
77+
- src/unstructured_client/models/shared/security.py
78+
- src/unstructured_client/models/shared/validationerror.py
4879
- src/unstructured_client/py.typed
80+
- src/unstructured_client/sdk.py
81+
- src/unstructured_client/sdkconfiguration.py
4982
- src/unstructured_client/types/__init__.py
5083
- src/unstructured_client/types/basemodel.py
5184
- src/unstructured_client/utils/__init__.py
@@ -54,6 +87,7 @@ generatedFiles:
5487
- src/unstructured_client/utils/eventstreaming.py
5588
- src/unstructured_client/utils/forms.py
5689
- src/unstructured_client/utils/headers.py
90+
- src/unstructured_client/utils/logger.py
5791
- src/unstructured_client/utils/metadata.py
5892
- src/unstructured_client/utils/queryparams.py
5993
- src/unstructured_client/utils/requestbodies.py
@@ -62,32 +96,15 @@ generatedFiles:
6296
- src/unstructured_client/utils/serializers.py
6397
- src/unstructured_client/utils/url.py
6498
- src/unstructured_client/utils/values.py
65-
- src/unstructured_client/models/errors/sdkerror.py
66-
- src/unstructured_client/models/operations/partition.py
67-
- src/unstructured_client/models/operations/__init__.py
68-
- src/unstructured_client/models/errors/httpvalidationerror.py
69-
- src/unstructured_client/models/errors/servererror.py
70-
- src/unstructured_client/models/errors/__init__.py
71-
- src/unstructured_client/models/shared/validationerror.py
72-
- src/unstructured_client/models/shared/partition_parameters.py
73-
- src/unstructured_client/models/shared/security.py
74-
- src/unstructured_client/models/shared/__init__.py
75-
- docs/models/operations/partitionrequest.md
76-
- docs/models/operations/partitionresponse.md
77-
- docs/models/errors/detail.md
78-
- docs/models/errors/httpvalidationerror.md
79-
- docs/models/errors/servererror.md
80-
- docs/models/shared/loc.md
81-
- docs/models/shared/validationerror.md
82-
- docs/models/shared/chunkingstrategy.md
83-
- docs/models/shared/files.md
84-
- docs/models/shared/outputformat.md
85-
- docs/models/shared/strategy.md
86-
- docs/models/shared/partitionparameters.md
87-
- docs/models/shared/security.md
88-
- USAGE.md
89-
- .gitattributes
90-
- src/unstructured_client/_hooks/sdkhooks.py
91-
- src/unstructured_client/_hooks/types.py
92-
- src/unstructured_client/_hooks/__init__.py
93-
- CONTRIBUTING.md
99+
examples:
100+
partition:
101+
speakeasy-default-partition:
102+
requestBody:
103+
multipart/form-data: {"chunking_strategy": "by_title", "files": {"": "{\"summary\":\"File to be partitioned\",\"externalValue\":\"https://github.com/Unstructured-IO/unstructured/blob/98d3541909f64290b5efb65a226fc3ee8a7cc5ee/example-docs/layout-parser-paper.pdf\"}"}, "split_pdf_page_range": [1, 10], "strategy": "hi_res"}
104+
responses:
105+
"200":
106+
application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}]
107+
"422":
108+
application/json: {"detail": "<value>"}
109+
5XX:
110+
application/json: {"detail": "An error occurred"}

Diff for: .vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"python.testing.pytestArgs": ["tests", "-vv"],
3+
"python.testing.unittestEnabled": false,
4+
"python.testing.pytestEnabled": true,
5+
"pylint.args": ["--rcfile=pylintrc"]
6+
}

Diff for: Makefile

+4-9
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@ DOCKER_IMAGE ?= downloads.unstructured.io/unstructured-io/unstructured-api:lates
77
# Install #
88
###########
99

10-
.PHONY: install-test
11-
install-test:
12-
pip install pytest pytest-asyncio pytest-mock requests_mock pypdf deepdiff requests-toolbelt uvloop
13-
14-
.PHONY: install-dev
15-
install-dev:
16-
pip install jupyter uvloop pylint mypy
17-
1810
## install: installs all test, dev, and experimental requirements
1911
.PHONY: install
20-
install: install-test install-dev
12+
install:
13+
pip install poetry
14+
python scripts/prepare-readme.py
15+
poetry install
2116

2217
#################
2318
# Test and Lint #

Diff for: README.md

+65-18
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,45 @@ This is a Python client for the [Unstructured API](https://docs.unstructured.io/
2929

3030
Please refer to the [Unstructured docs](https://docs.unstructured.io/api-reference/api-services/sdk-python) for a full guide to using the client.
3131

32+
<!-- Start Summary [summary] -->
33+
## Summary
34+
35+
36+
<!-- End Summary [summary] -->
37+
38+
<!-- Start Table of Contents [toc] -->
39+
## Table of Contents
40+
41+
* [SDK Installation](#sdk-installation)
42+
* [IDE Support](#ide-support)
43+
* [SDK Example Usage](#sdk-example-usage)
44+
* [Available Resources and Operations](#available-resources-and-operations)
45+
* [File uploads](#file-uploads)
46+
* [Retries](#retries)
47+
* [Error Handling](#error-handling)
48+
* [Server Selection](#server-selection)
49+
* [Custom HTTP Client](#custom-http-client)
50+
* [Authentication](#authentication)
51+
* [Debugging](#debugging)
52+
<!-- End Table of Contents [toc] -->
53+
3254
<!-- Start SDK Installation [installation] -->
3355
## SDK Installation
3456

35-
PIP
57+
The SDK can be installed with either *pip* or *poetry* package managers.
58+
59+
### PIP
60+
61+
*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
62+
3663
```bash
3764
pip install unstructured-client
3865
```
3966

40-
Poetry
67+
### Poetry
68+
69+
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
70+
4171
```bash
4272
poetry add unstructured-client
4373
```
@@ -143,16 +173,13 @@ from unstructured_client import UnstructuredClient
143173
from unstructured_client.models import shared
144174
from unstructured_client.utils import BackoffStrategy, RetryConfig
145175

146-
s = UnstructuredClient(
147-
api_key_auth="YOUR_API_KEY",
148-
)
149-
176+
s = UnstructuredClient()
150177

151178
res = s.general.partition(request={
152179
"partition_parameters": {
153180
"files": {
154-
"content": open("<file_path>", "rb"),
155-
"file_name": "your_file_here",
181+
"content": open("example.file", "rb"),
182+
"file_name": "example.file",
156183
},
157184
"chunking_strategy": shared.ChunkingStrategy.BY_TITLE,
158185
"split_pdf_page_range": [
@@ -178,15 +205,13 @@ from unstructured_client.utils import BackoffStrategy, RetryConfig
178205

179206
s = UnstructuredClient(
180207
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
181-
api_key_auth="YOUR_API_KEY",
182208
)
183209

184-
185210
res = s.general.partition(request={
186211
"partition_parameters": {
187212
"files": {
188-
"content": open("<file_path>", "rb"),
189-
"file_name": "your_file_here",
213+
"content": open("example.file", "rb"),
214+
"file_name": "example.file",
190215
},
191216
"chunking_strategy": shared.ChunkingStrategy.BY_TITLE,
192217
"split_pdf_page_range": [
@@ -292,6 +317,16 @@ s = UnstructuredClient(async_client=CustomClient(httpx.AsyncClient()))
292317
<!-- No Server Selection -->
293318
<!-- No Authentication -->
294319

320+
<!-- Start IDE Support [idesupport] -->
321+
## IDE Support
322+
323+
### PyCharm
324+
325+
Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
326+
327+
- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
328+
<!-- End IDE Support [idesupport] -->
329+
295330
<!-- Start File uploads [file-upload] -->
296331
## File uploads
297332

@@ -306,16 +341,13 @@ Certain SDK methods accept file objects as part of a request body or multi-part
306341
from unstructured_client import UnstructuredClient
307342
from unstructured_client.models import shared
308343

309-
s = UnstructuredClient(
310-
api_key_auth="YOUR_API_KEY",
311-
)
312-
344+
s = UnstructuredClient()
313345

314346
res = s.general.partition(request={
315347
"partition_parameters": {
316348
"files": {
317-
"content": open("<file_path>", "rb"),
318-
"file_name": "your_file_here",
349+
"content": open("example.file", "rb"),
350+
"file_name": "example.file",
319351
},
320352
"chunking_strategy": shared.ChunkingStrategy.BY_TITLE,
321353
"split_pdf_page_range": [
@@ -333,6 +365,21 @@ if res.elements is not None:
333365
```
334366
<!-- End File uploads [file-upload] -->
335367

368+
<!-- Start Debugging [debug] -->
369+
## Debugging
370+
371+
You can setup your SDK to emit debug logs for SDK requests and responses.
372+
373+
You can pass your own logger class directly into your SDK.
374+
```python
375+
from unstructured_client import UnstructuredClient
376+
import logging
377+
378+
logging.basicConfig(level=logging.DEBUG)
379+
s = UnstructuredClient(debug_logger=logging.getLogger("unstructured_client"))
380+
```
381+
<!-- End Debugging [debug] -->
382+
336383
<!-- Placeholder for Future Speakeasy SDK Sections -->
337384

338385
### Maturity

0 commit comments

Comments
 (0)