Python SDK for the Unstructured Platform API
Project description
Unstructured Platform SDK
A Python SDK for the Unstructured Platform API.
Unstructured Platform is an enterprise-grade ETL (Extract, Transform, Load) platform designed specifically for Large Language Models (LLMs). It provides a no-code UI and production-ready infrastructure to help organizations transform raw, unstructured data into LLM-ready formats. With over 18 million downloads and used by more than 50,000 companies, Unstructured Platform enables data scientists and engineers to spend less time collecting and cleaning data, and more time on modeling and analysis.
This SDK was developed by One Minute AI, the AI platform that provides a one-click (or one line of code) way to create AI assistants and apps using data ingested by Unstructured.
Installation
pip install unstructured-platform
Usage
Initialize the client
from unstructured_platform import UnstructuredPlatformClient
client = UnstructuredPlatformClient(api_key="your-api-key")
Working with Source Connectors
from unstructured_platform.models import PublicSourceConnectorType
# List source connectors
sources = client.sources.list()
# Create a source connector
source = client.sources.create(
name="My S3 Source",
type=PublicSourceConnectorType.S3,
config={
"remote_url": "s3://my-bucket/documents/",
"key": "your-access-key",
"secret": "your-secret-key",
},
)
# Get a source connector
source = client.sources.get(source_id="source-id")
# Update a source connector
updated_source = client.sources.update(
source_id="source-id",
config={
"remote_url": "s3://my-bucket/new-prefix/",
},
)
# Delete a source connector
client.sources.delete(source_id="source-id")
Working with Destination Connectors
from unstructured_platform_sdk.models import PublicDestinationConnectorType
# List destination connectors
destinations = client.destinations.list()
# Create a destination connector
destination = client.destinations.create(
name="My Pinecone Destination",
type=PublicDestinationConnectorType.PINECONE,
config={
"environment": "us-west1-gcp",
"api_key": "your-pinecone-api-key",
"index_name": "documents",
"namespace": "default",
},
)
# Get a destination connector
destination = client.destinations.get(destination_id="destination-id")
# Update a destination connector
updated_destination = client.destinations.update(
destination_id="destination-id",
config={
"namespace": "new-namespace",
},
)
# Delete a destination connector
client.destinations.delete(destination_id="destination-id")
Working with Workflows
from unstructured_platform_sdk.models import WorkflowAutoStrategy
# List workflows
workflows = client.workflows.list()
# Create a workflow
workflow = client.workflows.create(
name="My Daily Workflow",
source_id="source-id",
destination_id="destination-id",
workflow_type=WorkflowAutoStrategy.BASIC,
schedule="0 0 * * *", # Daily at midnight
)
# Get a workflow
workflow = client.workflows.get(workflow_id="workflow-id")
# Update a workflow
updated_workflow = client.workflows.update(
workflow_id="workflow-id",
name="New Workflow Name",
)
# Delete a workflow
client.workflows.delete(workflow_id="workflow-id")
# Run a workflow
workflow = client.workflows.run(workflow_id="workflow-id")
Working with Jobs
# List jobs
jobs = client.jobs.list()
# Get a job
job = client.jobs.get(job_id="job-id")
# Cancel a job
client.jobs.cancel(job_id="job-id")
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unstructured_platform-0.4.0.tar.gz.
File metadata
- Download URL: unstructured_platform-0.4.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a876bf5207e184b82302d6793c4447e1e94e7ff57e45f195462461fa21393aab
|
|
| MD5 |
dcc08d12b81cc7cfa0b92a2b5ed1ece3
|
|
| BLAKE2b-256 |
59e400d146f956e89a89e3fd28407a3a17a20216c48aefbe083491acce25bbab
|
File details
Details for the file unstructured_platform-0.4.0-py3-none-any.whl.
File metadata
- Download URL: unstructured_platform-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e58bf10ff8da86c339131b657bf23f1e0fbe3276653c2472bbd2fafc061d439
|
|
| MD5 |
41c2959420c2f18fca6071cd974a60e1
|
|
| BLAKE2b-256 |
294e2da3e74a5c509964857216d15c74f6462cf67cb6536a28450985e5a8ede1
|