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 to make it easier for Python developers to interact with the Unstructured Platform API. One Minute AI allows you to transform your data into custom AI assistants and apps in seconds, powered by Unstructured's enterprise data engine.

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.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.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")

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.3.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.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unstructured_platform-0.4.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ab770fb66385c1f0da77e40c4431ac7b928dc7f4934ba84c8bb5a7009318593d
MD5 2428ec1e160d45359aaaebc22a773c52
BLAKE2b-256 3cd9fb05d2b9a5923ba3e53e253b2d020ee709de4ce7e1ba544073ac8ca12c27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unstructured_platform-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 88e921c993d7768dbe72307f4b066252d3f51d24a4592a1d2a042299d8bf4a35
MD5 479d08b1205cd857516da7caa0627660
BLAKE2b-256 286b09d905408154c5ad70220eedbf9d257097835adb91a4295febd373ec9687

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