Skip to content

Commit 6091d9e

Browse files
github-actions[bot]speakeasybothubert-rutkowski85
authored
chore: 🐝 Update SDK - Generate (#57)
# SDK update Based on: - OpenAPI Doc 0.0.1 - Speakeasy CLI 1.201.1 (2.277.0) https://github.com/speakeasy-api/speakeasy ## PYTHON CHANGELOG --------- Co-authored-by: speakeasybot <[email protected]> Co-authored-by: hubert.rutkowski <[email protected]>
1 parent 6ab44e9 commit 6091d9e

File tree

10 files changed

+43
-16
lines changed

10 files changed

+43
-16
lines changed

Diff for: .speakeasy/gen.lock

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
4-
docChecksum: a112aea005467aa6818696fa4e99fcfe
4+
docChecksum: 0474212adfef86a6c183841a3cb9d75b
55
docVersion: 0.0.1
66
speakeasyVersion: internal
77
generationVersion: 2.277.0
8-
releaseVersion: 0.21.0
9-
configChecksum: c5e7c8526f43272d7585627468d8c4e5
8+
releaseVersion: 0.21.1
9+
configChecksum: 37b07ca4ef319a1d49602f97748e7aba
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
@@ -51,6 +51,7 @@ generatedFiles:
5151
- docs/models/shared/security.md
5252
- USAGE.md
5353
- .gitattributes
54+
- src/unstructured_client/_hooks/registration.py
5455
- src/unstructured_client/_hooks/sdkhooks.py
5556
- src/unstructured_client/_hooks/types.py
5657
- src/unstructured_client/_hooks/__init__.py

Diff for: RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,14 @@ Based on:
454454
### Generated
455455
- [python v0.21.0] .
456456
### Releases
457-
- [PyPI v0.21.0] https://pypi.org/project/unstructured-client/0.21.0 - .
457+
- [PyPI v0.21.0] https://pypi.org/project/unstructured-client/0.21.0 - .
458+
459+
## 2024-03-05 22:38:33
460+
### Changes
461+
Based on:
462+
- OpenAPI Doc 0.0.1
463+
- Speakeasy CLI 1.201.1 (2.277.0) https://github.com/speakeasy-api/speakeasy
464+
### Generated
465+
- [python v0.21.1] .
466+
### Releases
467+
- [PyPI v0.21.1] https://pypi.org/project/unstructured-client/0.21.1 - .

Diff for: gen.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ generation:
1010
auth:
1111
oAuth2ClientCredentialsEnabled: false
1212
python:
13-
version: 0.21.0
13+
version: 0.21.1
1414
additionalDependencies:
1515
dependencies:
16-
pypdf: '>=4.0'
1716
deepdiff: '>=6.0'
17+
pypdf: '>=4.0'
1818
extraDependencies:
1919
dev: {}
2020
author: Unstructured

Diff for: setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="unstructured-client",
13-
version="0.21.0",
13+
version="0.21.1",
1414
author="Unstructured",
1515
description="Python Client SDK for Unstructured API",
1616
license = "MIT",
@@ -21,19 +21,19 @@
2121
"certifi>=2023.7.22",
2222
"charset-normalizer>=3.2.0",
2323
"dataclasses-json>=0.6.4",
24+
"deepdiff>=6.0",
2425
"idna>=3.4",
2526
"jsonpath-python>=1.0.6",
2627
"marshmallow>=3.19.0",
2728
"mypy-extensions>=1.0.0",
2829
"packaging>=23.1",
30+
"pypdf>=4.0",
2931
"python-dateutil>=2.8.2",
3032
"requests>=2.31.0",
3133
"six>=1.16.0",
3234
"typing-inspect>=0.9.0",
3335
"typing_extensions>=4.7.1",
3436
"urllib3>=1.26.18",
35-
"pypdf>=4.0", # human code
36-
"deepdiff>=6.0", # human code
3737
],
3838
extras_require={
3939
"dev": [

Diff for: src/unstructured_client/_hooks/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
from .sdkhooks import *
44
from .types import *
5+
from .registration import *

Diff for: src/unstructured_client/_hooks/registration.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from .types import Hooks
2+
3+
4+
# This file is only ever generated once on the first generation and then is free to be modified.
5+
# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them
6+
# in this file or in separate files in the hooks folder.
7+
8+
9+
def init_hooks(hooks: Hooks):
10+
# pylint: disable=unused-argument
11+
"""Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook
12+
with an instance of a hook that implements that specific Hook interface
13+
Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance"""

Diff for: src/unstructured_client/_hooks/sdkhooks.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import requests
44
from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks
5+
from .registration import init_hooks
56
from typing import List, Optional, Tuple, Union
67

78

@@ -12,7 +13,7 @@ class SDKHooks(Hooks):
1213
after_error_hooks: List[AfterErrorHook] = []
1314

1415
def __init__(self):
15-
pass
16+
init_hooks(self)
1617

1718
def register_sdk_init_hook(self, hook: SDKInitHook) -> None:
1819
self.sdk_init_hooks.append(hook)

Diff for: src/unstructured_client/general.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def partition(self, request: Optional[shared.PartitionParameters], retries: Opti
3636
else:
3737
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)
3838

39-
39+
4040
global_retry_config = self.sdk_configuration.retry_config
4141
retry_config = retries
4242
if retry_config is None:
@@ -48,7 +48,7 @@ def partition(self, request: Optional[shared.PartitionParameters], retries: Opti
4848
def do_request():
4949
try:
5050
req = self.sdk_configuration.get_hooks().before_request(
51-
hook_ctx,
51+
hook_ctx,
5252
requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(),
5353
)
5454
http_res = client.send(req)
@@ -71,7 +71,7 @@ def do_request():
7171
http_res = utils.retry(do_request, utils.Retries(retry_config, [
7272
'5xx'
7373
]))
74-
74+
7575
content_type = http_res.headers.get('Content-Type')
7676

7777
res = operations.PartitionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
@@ -94,3 +94,4 @@ def do_request():
9494

9595
return res
9696

97+

Diff for: src/unstructured_client/sdk.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from unstructured_client.models import shared
1010
from unstructured_client.utils._human_utils import clean_server_url # human code
1111

12+
1213
class UnstructuredClient:
1314
r"""Unstructured Pipeline API: Partition documents with the Unstructured library"""
1415
general: General
@@ -68,4 +69,3 @@ def security():
6869

6970
def _init_sdks(self):
7071
self.general = General(self.sdk_configuration)
71-

Diff for: src/unstructured_client/sdkconfiguration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class SDKConfiguration:
2929
server: str = ''
3030
language: str = 'python'
3131
openapi_doc_version: str = '0.0.1'
32-
sdk_version: str = '0.21.0'
32+
sdk_version: str = '0.21.1'
3333
gen_version: str = '2.277.0'
34-
user_agent: str = 'speakeasy-sdk/python 0.21.0 2.277.0 0.0.1 unstructured-client'
34+
user_agent: str = 'speakeasy-sdk/python 0.21.1 2.277.0 0.0.1 unstructured-client'
3535
retry_config: RetryConfig = None
3636
_hooks: SDKHooks = None
3737

0 commit comments

Comments
 (0)