diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e7f7df00..f048ea78 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b5fa338-9106-4734-abf0-e30d67044a90 management: - docChecksum: 3956d4428b6275f96d6859db352f202f - docVersion: 1.0.30 - speakeasyVersion: 1.295.1 - generationVersion: 2.335.5 - releaseVersion: 0.26.5 - configChecksum: 06b34b8ab68e59b2fec780ed1663e371 + docChecksum: 95cf473b65c812e2a731bc586e691f89 + docVersion: 1.0.32 + speakeasyVersion: 1.299.4 + generationVersion: 2.338.7 + releaseVersion: 0.27.0 + configChecksum: f30a94fe7726e498bf687d6aefa48ec4 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -23,6 +23,7 @@ features: globalServerURLs: 2.82.2 nameOverrides: 2.81.2 nullables: 0.1.0 + openEnums: 0.1.0 responseFormat: 0.1.0 retries: 2.82.2 sdkHooks: 0.1.0 @@ -37,6 +38,7 @@ generatedFiles: - setup.py - src/unstructured_client/__init__.py - src/unstructured_client/utils/__init__.py + - src/unstructured_client/utils/enums.py - src/unstructured_client/utils/retries.py - src/unstructured_client/utils/utils.py - src/unstructured_client/models/errors/sdkerror.py diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index e4dabf07..774a48a7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.295.1 +speakeasyVersion: 1.299.4 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:bad4b97e6b725d31784534a0eb12c6a679f8b9c266ab6ac6233157c86df73900 - sourceBlobDigest: sha256:68a72efa165cf4635ab30f872a9b6e3a2057cdcc689254bb96feb30c7b7970bd + sourceRevisionDigest: sha256:1f77ecb5a93c98a2666959cc431213df275eb3daf04c08c78f76b4d28579d765 + sourceBlobDigest: sha256:823dd5db79564693f9fe02a562840c3fe02a6cd546917e9bac7aecd60dd8c260 tags: - latest - main @@ -11,8 +11,8 @@ targets: unstructured-python: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:bad4b97e6b725d31784534a0eb12c6a679f8b9c266ab6ac6233157c86df73900 - sourceBlobDigest: sha256:68a72efa165cf4635ab30f872a9b6e3a2057cdcc689254bb96feb30c7b7970bd + sourceRevisionDigest: sha256:1f77ecb5a93c98a2666959cc431213df275eb3daf04c08c78f76b4d28579d765 + sourceBlobDigest: sha256:823dd5db79564693f9fe02a562840c3fe02a6cd546917e9bac7aecd60dd8c260 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index b375d1a3..1d732a56 100755 --- a/README.md +++ b/README.md @@ -166,9 +166,9 @@ res = s.general.partition(request=operations.PartitionRequest( partition_parameters=shared.PartitionParameters( files=shared.Files( content='0x2cC94b2FEF'.encode(), - file_name='um.shtml', + file_name='your_file_here', ), - strategy=shared.Strategy.HI_RES, + strategy=shared.Strategy.AUTO, ), )) diff --git a/RELEASES.md b/RELEASES.md index b8f21063..0f0dd039 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -554,4 +554,12 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.295.1 (2.335.5) https://github.com/speakeasy-api/speakeasy ### Generated -- [python v0.26.5] . \ No newline at end of file +- [python v0.26.5] . + +## 2024-06-03 00:52:27 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.299.4 (2.338.7) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.27.0] . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 03375aff..3af1a129 100644 --- a/USAGE.md +++ b/USAGE.md @@ -12,9 +12,9 @@ res = s.general.partition(request=operations.PartitionRequest( partition_parameters=shared.PartitionParameters( files=shared.Files( content='0x2cC94b2FEF'.encode(), - file_name='um.shtml', + file_name='your_file_here', ), - strategy=shared.Strategy.HI_RES, + strategy=shared.Strategy.AUTO, ), )) diff --git a/codeSamples.yaml b/codeSamples.yaml index 72589b32..c3665e64 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -20,10 +20,10 @@ actions: res = s.general.partition(request=operations.PartitionRequest( partition_parameters=shared.PartitionParameters( files=shared.Files( - file_name='and.wav', - content='0xb2FEF2EFFf'.encode(), + file_name='your_file_here', + content='0x2cC94b2FEF'.encode(), ), - strategy=shared.Strategy.HI_RES, + strategy=shared.Strategy.AUTO, ), )) diff --git a/docs/models/shared/partitionparameters.md b/docs/models/shared/partitionparameters.md index d79ff954..517c92d1 100644 --- a/docs/models/shared/partitionparameters.md +++ b/docs/models/shared/partitionparameters.md @@ -30,5 +30,5 @@ | `split_pdf_page` | *Optional[bool]* | :heavy_minus_sign: | This parameter determines if the PDF file should be split on the client side. It's an internal parameter for the Python client and is not sent to the backend. | | | `starting_page_number` | *Optional[int]* | :heavy_minus_sign: | When PDF is split into pages before sending it into the API, providing this information will allow the page number to be assigned correctly. Introduced in 1.0.27. | | | `strategy` | [Optional[shared.Strategy]](../../models/shared/strategy.md) | :heavy_minus_sign: | The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: auto | auto | -| `unique_element_ids` | *Optional[bool]* | :heavy_minus_sign: | When `True`, assign UUIDs to element IDs, which guarantees their uniqueness
(useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: False | | +| `unique_element_ids` | *Optional[bool]* | :heavy_minus_sign: | When `True`, assign UUIDs to element IDs, which guarantees their uniqueness (useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: False | | | `xml_keep_tags` | *Optional[bool]* | :heavy_minus_sign: | If True, will retain the XML tags in the output. Otherwise it will simply extract the text from within the tags. Only applies to partition_xml. | | \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 680e4bfd..73af646a 100644 --- a/gen.yaml +++ b/gen.yaml @@ -10,13 +10,13 @@ generation: auth: oAuth2ClientCredentialsEnabled: false python: - version: 0.26.5 + version: 0.27.0 additionalDependencies: dependencies: - deepdiff: ">=6.0" - pypdf: ">=4.0" - requests-toolbelt: ">=1.0.0" - httpx: ">=0.27.0" + deepdiff: '>=6.0' + httpx: '>=0.27.0' + pypdf: '>=4.0' + requests-toolbelt: '>=1.0.0' extraDependencies: dev: {} author: Unstructured diff --git a/setup.py b/setup.py index 19a94b7c..0758cfac 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setuptools.setup( name='unstructured-client', - version='0.26.5', + version='0.27.0', author='Unstructured', description='Python Client SDK for Unstructured API', license = 'MIT', @@ -32,6 +32,7 @@ "charset-normalizer>=3.2.0", "dataclasses-json>=0.6.4", "deepdiff>=6.0", + "httpx>=0.27.0", "idna>=3.4", "jsonpath-python>=1.0.6", "marshmallow>=3.19.0", @@ -45,7 +46,6 @@ "typing-inspect>=0.9.0", "typing_extensions>=4.7.1", "urllib3>=1.26.18", - "httpx>=0.27.0", ], extras_require={ "dev": [ diff --git a/src/unstructured_client/models/shared/partition_parameters.py b/src/unstructured_client/models/shared/partition_parameters.py index 1bb29f1f..904e3031 100644 --- a/src/unstructured_client/models/shared/partition_parameters.py +++ b/src/unstructured_client/models/shared/partition_parameters.py @@ -4,9 +4,10 @@ import dataclasses from enum import Enum from typing import List, Optional +from unstructured_client import utils -class ChunkingStrategy(str, Enum): +class ChunkingStrategy(str, Enum, metaclass=utils.OpenEnumMeta): BASIC = 'basic' BY_PAGE = 'by_page' BY_SIMILARITY = 'by_similarity' @@ -21,13 +22,13 @@ class Files: -class OutputFormat(str, Enum): +class OutputFormat(str, Enum, metaclass=utils.OpenEnumMeta): r"""The format of the response. Supported formats are application/json and text/csv. Default: application/json.""" APPLICATION_JSON = 'application/json' TEXT_CSV = 'text/csv' -class Strategy(str, Enum): +class Strategy(str, Enum, metaclass=utils.OpenEnumMeta): r"""The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: auto""" FAST = 'fast' HI_RES = 'hi_res' @@ -89,9 +90,7 @@ class PartitionParameters: strategy: Optional[Strategy] = dataclasses.field(default=Strategy.AUTO, metadata={'multipart_form': { 'field_name': 'strategy' }}) r"""The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: auto""" unique_element_ids: Optional[bool] = dataclasses.field(default=False, metadata={'multipart_form': { 'field_name': 'unique_element_ids' }}) - r"""When `True`, assign UUIDs to element IDs, which guarantees their uniqueness - (useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: False - """ + r"""When `True`, assign UUIDs to element IDs, which guarantees their uniqueness (useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: False""" xml_keep_tags: Optional[bool] = dataclasses.field(default=False, metadata={'multipart_form': { 'field_name': 'xml_keep_tags' }}) r"""If True, will retain the XML tags in the output. Otherwise it will simply extract the text from within the tags. Only applies to partition_xml.""" diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index e4e43b4b..61d01e16 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -28,10 +28,10 @@ class SDKConfiguration: server_url: Optional[str] = '' server: Optional[str] = '' language: str = 'python' - openapi_doc_version: str = '1.0.30' - sdk_version: str = '0.26.5' - gen_version: str = '2.335.5' - user_agent: str = 'speakeasy-sdk/python 0.26.5 2.335.5 1.0.30 unstructured-client' + openapi_doc_version: str = '1.0.32' + sdk_version: str = '0.27.0' + gen_version: str = '2.338.7' + user_agent: str = 'speakeasy-sdk/python 0.27.0 2.338.7 1.0.32 unstructured-client' retry_config: Optional[RetryConfig] = None def __post_init__(self): diff --git a/src/unstructured_client/utils/__init__.py b/src/unstructured_client/utils/__init__.py index 94b73985..a4fca38b 100644 --- a/src/unstructured_client/utils/__init__.py +++ b/src/unstructured_client/utils/__init__.py @@ -2,3 +2,5 @@ from .retries import * from .utils import * +from .enums import * + diff --git a/src/unstructured_client/utils/enums.py b/src/unstructured_client/utils/enums.py new file mode 100644 index 00000000..7e8bc83c --- /dev/null +++ b/src/unstructured_client/utils/enums.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import enum + +class OpenEnumMeta(enum.EnumMeta): + def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__(value, names=names, module=module, qualname=qualname, type=type, start=start) + + try: + return super().__call__(value, names=names, module=module, qualname=qualname, type=type, start=start) + except ValueError: + return value