# unstructured-client

> Python Client SDK for Unstructured API

- **URL**: https://www.freshcrate.ai/projects/unstructured-client
- **Author**: Unstructured
- **Category**: Developer Tools
- **Latest version**: `v0.45.0` (2026-06-05)
- **License**: MIT
- **Source**: https://github.com/Unstructured-IO/unstructured-python-client.git
- **Homepage**: https://pypi.org/project/unstructured-client/
- **Language**: Python
- **GitHub**: 116 stars, 20 forks
- **Registry**: pypi (`unstructured-client`)
- **Tags**: `pypi`

## Description

<h3 align="center">
  <img
    src="https://raw.githubusercontent.com/Unstructured-IO/unstructured/main/img/unstructured_logo.png"
    height="200"
  >
</h3>

<div align="center">
    <a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
</div>

<div align="center">

</div>

<h2 align="center">
  <p>Python SDK for the Unstructured API</p>
</h2>

This is a HTTP client for the [Unstructured Platform API](https://docs.unstructured.io/platform-api/overview). You can sign up [here](https://unstructured.io/developers) and process 1000 free pages per day for 14 days.

Please refer to the our documentation for a full guide on integrating the [Workflow Endpoint](https://docs.unstructured.io/platform-api/api/overview) and [Partition Endpoint](https://docs.unstructured.io/platform-api/partition-api/sdk-python) into your Python code.

<!-- Start Summary [summary] -->
## Summary


<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
  * [SDK Installation](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#sdk-installation)
  * [Retries](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#retries)
  * [Error Handling](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#error-handling)
  * [Custom HTTP Client](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#custom-http-client)
  * [IDE Support](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#ide-support)
  * [SDK Example Usage](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#sdk-example-usage)
  * [Configuration](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#configuration)
  * [File uploads](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#file-uploads)
  * [Resource Management](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#resource-management)
  * [Debugging](https://github.com/Unstructured-IO/unstructured-python-client/blob/master/#debugging)

<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
## SDK Installation

> [!NOTE]
> **Python version upgrade policy**
>
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.

The SDK can be installed with *uv*, *pip*, or *poetry* package managers.

### uv

*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.

```bash
uv add unstructured-client
```

### PIP

*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

```bash
pip install unstructured-client
```

### Poetry

*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.

```bash
poetry add unstructured-client
```

### Shell and script usage with `uv`

You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:

```shell
uvx --from unstructured-client python
```

It's also possible to write a standalone Python script without needing to set up a whole project like so:

```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
#     "unstructured-client",
# ]
# ///

from unstructured_client import UnstructuredClient

sdk = UnstructuredClient(
  # SDK arguments
)

# Rest of script here...
```

Once that is saved to a file, you can run it with `uv run script.py` where
`script.py` can be replaced with the actual file name.
<!-- End SDK Installation [installation] -->


<!-- Start Retries [retries] -->
## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
```python
from unstructured_client import UnstructuredClient
from unstructured_client.utils import BackoffStrategy, RetryConfig


with UnstructuredClient() as uc_client:

    res = uc_client.destinations.create_connection_check_destinations(request={
        "destination_id": "cb9e35c1-0b04-4d98-83fa-fa6241323f96",
    },
        RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v0.45.0` | 2026-06-05 | High | ### Features * Make the split-PDF `httpx.AsyncClient` connection-pool limits configurable via env vars: `UNSTRUCTURED_CLIENT_MAX_CONNECTIONS` (default `100`), `UNSTRUCTURED_CLIENT_MAX_KEEPALIVE_CONNECTIONS` (default `20`), and `UNSTRUCTURED_CLIENT_KEEPALIVE_EXPIRY` (default `5.0`s). Defaults match httpx, so behavior is unchanged unless set. Useful when deploying behind a connect-time-only load balancer (e.g. Kubernetes ClusterIP without a mesh) where shorter keepalives force connections to redis |
| `v0.44.1` | 2026-05-27 | High | ### Features * Add `min_attempts` and `absolute_max_elapsed_time_ms` fields to `BackoffStrategy`. `min_attempts` is the minimum number of retry attempts that must fire before `max_elapsed_time` is honored; defaults to `0` (preserves existing behavior). `absolute_max_elapsed_time_ms` caps when a new retry can start (does not interrupt in-flight requests); defaults to `None`. Together these close a short-circuit where a single slow first attempt could exhaust the retry budget before any retry fire |
| `v0.44.0` | 2026-05-07 | High | ## 0.44.0  ### Breaking changes * Removed deprecated connector config models from the SDK (e.g. `S3SourceConnectorConfig`, `AzureDestinationConnectorConfig`). Pass connector configs as plain dicts with arbitrary fields. The SDK is no longer coupled to backend connector schemas — new fields work without an SDK upgrade. |
| `0.43.2` | 2026-04-21 | Low | Imported from PyPI (0.43.2) |
| `v0.43.2` | 2026-04-04 | Medium | ## What's Changed * Enable trusted publishing by @PastelStorm in https://github.com/Unstructured-IO/unstructured-python-client/pull/337   **Full Changelog**: https://github.com/Unstructured-IO/unstructured-python-client/compare/v0.43.1...v0.43.2 |
| `v0.43.2` | 2026-04-04 | Medium | ## What's Changed * Enable trusted publishing by @PastelStorm in https://github.com/Unstructured-IO/unstructured-python-client/pull/337   **Full Changelog**: https://github.com/Unstructured-IO/unstructured-python-client/compare/v0.43.1...v0.43.2 |
| `v0.43.2` | 2026-04-04 | Medium | ## What's Changed * Enable trusted publishing by @PastelStorm in https://github.com/Unstructured-IO/unstructured-python-client/pull/337   **Full Changelog**: https://github.com/Unstructured-IO/unstructured-python-client/compare/v0.43.1...v0.43.2 |
| `v0.43.2` | 2026-04-04 | Medium | ## What's Changed * Enable trusted publishing by @PastelStorm in https://github.com/Unstructured-IO/unstructured-python-client/pull/337   **Full Changelog**: https://github.com/Unstructured-IO/unstructured-python-client/compare/v0.43.1...v0.43.2 |
| `v0.43.2` | 2026-04-04 | Medium | ## What's Changed * Enable trusted publishing by @PastelStorm in https://github.com/Unstructured-IO/unstructured-python-client/pull/337   **Full Changelog**: https://github.com/Unstructured-IO/unstructured-python-client/compare/v0.43.1...v0.43.2 |
| `v0.43.2` | 2026-04-04 | Medium | ## What's Changed * Enable trusted publishing by @PastelStorm in https://github.com/Unstructured-IO/unstructured-python-client/pull/337   **Full Changelog**: https://github.com/Unstructured-IO/unstructured-python-client/compare/v0.43.1...v0.43.2 |

## Citation

- HTML: https://www.freshcrate.ai/projects/unstructured-client
- Markdown: https://www.freshcrate.ai/projects/unstructured-client.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/unstructured-client/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
