Python SDK
The FissionBox Python SDK provides programmatic access to the platform's document processing, account, and asset APIs.
Client Setup
from fissionbox.cli.utils.env import (
get_document_client,
get_idp_client,
get_asset_client,
resolve_namespace_id,
)
namespace_id = resolve_namespace_id(None) # reads FISSIONBOX_NAMESPACE_ID or config
doc_client = get_document_client(namespace_id)
# IDP client (platform document-processing endpoints)
idp_client = get_idp_client()
asset_client = get_asset_client()
Upload
source_path = doc_client.upload(namespace_id, "invoice.pdf")
Queue Async Batch
result = idp_client.queue_batch(
namespace_id=namespace_id,
source_paths=[source_path],
extract_images=True,
)
doc_id = result["items"][0]["document_id"]
Poll Status
doc = doc_client.get(namespace_id, doc_id)
print(doc["metadata"]["status"]) # queued | processing | ready | failed
Download Results
asset_client.download(
namespace_id,
doc["metadata"]["responsePath"],
"./output/response.json",
)
Generate Annotated PDF
annotation = idp_client.annotate_stored(namespace_id, doc_id, detail="all")
asset_client.download(namespace_id, annotation["annotated_pdf_path"], "./output/annotated.pdf")
Available Clients
| Client | Purpose |
|---|---|
DocumentClient | Upload, list, and get document metadata |
IdpClient | Queue batches, process documents, annotate, get stored responses |
AssetClient | Download artifact files |
AccountClient | Account info, service accounts, tokens |
Examples
See the examples/ directory for complete working scripts:
| File | What it shows |
|---|---|
01_login.py | Auth status check |
02_process_single_pdf.py | Single-PDF pipeline — upload, process, annotated PDF, images |
03_queue_and_watch.py | Async batch queue with rich live table and organized downloads |
04_cli_quickstart.sh | Full CLI walkthrough |