Skip to main content

Python SDK for the Unstructured Platform API

Project description

Unstructured Platform SDK

Unstructured.io Logo

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

unstructured_platform-0.4.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unstructured_platform-0.4.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

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

Hashes for unstructured_platform-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a876bf5207e184b82302d6793c4447e1e94e7ff57e45f195462461fa21393aab
MD5 dcc08d12b81cc7cfa0b92a2b5ed1ece3
BLAKE2b-256 59e400d146f956e89a89e3fd28407a3a17a20216c48aefbe083491acce25bbab

See more details on using hashes here.

File details

Details for the file unstructured_platform-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unstructured_platform-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e58bf10ff8da86c339131b657bf23f1e0fbe3276653c2472bbd2fafc061d439
MD5 41c2959420c2f18fca6071cd974a60e1
BLAKE2b-256 294e2da3e74a5c509964857216d15c74f6462cf67cb6536a28450985e5a8ede1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page