Skip to main content
The FlexOrch Python SDK lets you upload unstructured files, monitor processing jobs, and export LLM-ready datasets — all from a clean, Pythonic interface. This guide walks you through installation and your first end-to-end document run.

Prerequisites

  • Python 3.10 or later
  • A FlexOrch API key (format: dfx_<random_string>) — find yours in the FlexOrch dashboard

Installation

1
Install the package
2
pip install flexorch-sdk
3
Store your API key
4
Never hardcode credentials. Add your key to your environment instead:
5
export FLEXORCH_API_KEY="dfx_your_key_here"
6
Initialize the client
7
import os
from flexorch import FlexOrch

client = FlexOrch(api_key=os.environ["FLEXORCH_API_KEY"])
8
If FLEXORCH_API_KEY is set in your environment, you can omit the api_key argument entirely — the SDK picks it up automatically.
9
Upload your first document
10
Pass any local file path to client.documents.upload(). The method returns a Job object immediately.
11
job = client.documents.upload("invoice.pdf")
print(f"Job created: {job.id}  |  Status: {job.status}")
12
Wait for processing to complete
13
Call job.wait_until_done() to block until the job reaches a terminal state (completed or failed). The SDK handles polling and back-off for you.
14
job = job.wait_until_done()
15
Inspect the results
16
print(f"Quality grade:    {job.quality_grade}")          # "A" | "B" | "C" | "D"
print(f"Quality score:    {job.quality_score:.2f}")       # 0.0 – 1.0
print(f"PII findings:     {job.pii_findings_count}")
print(f"Summary:          {job.processing_summary}")

Full working example

import os
from flexorch import FlexOrch

client = FlexOrch(api_key=os.environ["FLEXORCH_API_KEY"])

# Upload a document
job = client.documents.upload("invoice.pdf")
print(f"Uploaded — job ID: {job.id}")

# Wait for the pipeline to finish
job = job.wait_until_done()

if job.status == "completed":
    print(f"Grade:         {job.quality_grade}")
    print(f"Score:         {job.quality_score:.2f}")
    print(f"PII findings:  {job.pii_findings_count}")
    print(f"Summary:       {job.processing_summary}")
else:
    print(f"Job failed: {job.processing_summary}")
Processing time depends on file size and plan tier. Most documents under 10 MB complete within 30 seconds on the Growth plan.

Next steps

Upload Documents

Learn single-file, batch, and connector-based upload patterns.

Manage Jobs

Poll job status, filter by quality grade, and submit feedback.

Build Datasets

Combine completed jobs into exportable, LLM-ready datasets.

API Reference

Full class and method reference for the Python SDK.