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_sdk import UnstructuredPlatformClient

client = UnstructuredPlatformClient(api_key="your-api-key")

Working with Source Connectors

from unstructured_platform_sdk.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 Elasticsearch Destination",
    type=PublicDestinationConnectorType.ELASTICSEARCH,
    config={
        "host": "https://my-es-cluster.com",
        "index": "documents",
        "api_key": "your-es-api-key",
    },
)

# 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={
        "index": "new-index",
    },
)

# Delete a destination connector
client.destinations.delete(destination_id="destination-id")

Working with Workflows

from unstructured_platform.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.3.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.3.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file unstructured_platform-0.3.0.tar.gz.

File metadata

  • Download URL: unstructured_platform-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 9cbdcb3e68a1c4be1836f0fa466555548885f2f85844200430165049ee9859af
MD5 4160037799c87f22c35363498a9f9f63
BLAKE2b-256 c995ae19dec9ab16ced88d33414c42fa681af113c8dff2feec9d04dd965c6d56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unstructured_platform-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44378d630b020cdd270bc44da1e0c2a61920c3f45a3cb416236db4f53c5de6d0
MD5 0f14a221e59ee54d9fdb0efd3439679c
BLAKE2b-256 fdd79288e07f96e0af66c4082d60b9d320bb693cc4ba62c25f8e25d2d52882e1

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