Skip to content

Commit d3ce791

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.396.9
1 parent 6b81735 commit d3ce791

Some content is hidden

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

53 files changed

+1910
-400
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
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/

.speakeasy/gen.lock

Lines changed: 61 additions & 44 deletions
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.9
7+
generationVersion: 2.415.7
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"}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
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+
}

README.md

Lines changed: 65 additions & 18 deletions
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

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,4 +644,14 @@ Based on:
644644
### Generated
645645
- [python v0.25.5] .
646646
### Releases
647-
- [PyPI v0.25.5] https://pypi.org/project/unstructured-client/0.25.5 - .
647+
- [PyPI v0.25.5] https://pypi.org/project/unstructured-client/0.25.5 - .
648+
649+
## 2024-09-16 00:09:37
650+
### Changes
651+
Based on:
652+
- OpenAPI Doc
653+
- Speakeasy CLI 1.396.9 (2.415.7) https://github.com/speakeasy-api/speakeasy
654+
### Generated
655+
- [python v0.26.0-beta.1] .
656+
### Releases
657+
- [PyPI v0.26.0-beta.1] https://pypi.org/project/unstructured-client/0.26.0-beta.1 - .

USAGE.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
from unstructured_client import UnstructuredClient
55
from unstructured_client.models import shared
66

7-
s = UnstructuredClient(
8-
api_key_auth="YOUR_API_KEY",
9-
)
10-
7+
s = UnstructuredClient()
118

129
res = s.general.partition(request={
1310
"partition_parameters": {
1411
"files": {
15-
"content": open("<file_path>", "rb"),
16-
"file_name": "your_file_here",
12+
"content": open("example.file", "rb"),
13+
"file_name": "example.file",
1714
},
1815
"chunking_strategy": shared.ChunkingStrategy.BY_TITLE,
1916
"split_pdf_page_range": [
@@ -39,21 +36,19 @@ from unstructured_client import UnstructuredClient
3936
from unstructured_client.models import shared
4037

4138
async def main():
42-
s = UnstructuredClient(
43-
api_key_auth="YOUR_API_KEY",
44-
)
39+
s = UnstructuredClient()
4540
res = await s.general.partition_async(request={
4641
"partition_parameters": {
4742
"files": {
48-
"content": open("<file_path>", "rb"),
49-
"file_name": "your_file_here",
43+
"content": open("example.file", "rb"),
44+
"file_name": "example.file",
5045
},
51-
"chunking_strategy": shared.ChunkingStrategy.BASIC,
46+
"chunking_strategy": shared.ChunkingStrategy.BY_TITLE,
5247
"split_pdf_page_range": [
5348
1,
5449
10,
5550
],
56-
"strategy": shared.Strategy.AUTO,
51+
"strategy": shared.Strategy.HI_RES,
5752
},
5853
})
5954
if res.elements is not None:

docs/models/shared/files.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
## Fields
55

6-
| Field | Type | Required | Description |
7-
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
8-
| `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A |
9-
| `file_name` | *str* | :heavy_check_mark: | N/A |
10-
| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
6+
| Field | Type | Required | Description | Example |
7+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8+
| `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | {<br/>"summary": "File to be partitioned",<br/>"externalValue": "https://github.com/Unstructured-IO/unstructured/blob/98d3541909f64290b5efb65a226fc3ee8a7cc5ee/example-docs/layout-parser-paper.pdf"<br/>} |
9+
| `file_name` | *str* | :heavy_check_mark: | N/A | {<br/>"summary": "File to be partitioned",<br/>"externalValue": "https://github.com/Unstructured-IO/unstructured/blob/98d3541909f64290b5efb65a226fc3ee8a7cc5ee/example-docs/layout-parser-paper.pdf"<br/>} |
10+
| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | |

0 commit comments

Comments
 (0)