Skip to main content

Python SDK

The official Python SDK for Structurify provides a simple, Pythonic interface to the document extraction API.

PyPI version Python 3.8+

Installation

pip install structurify

Quick Start

from structurify import Structurify

# Initialize client
client = Structurify(api_key="sk_live_your_api_key")

# List available templates
templates = client.templates.list()
for template in templates:
print(f"{template['name']} - {template['id']}")

# Create a project
project = client.projects.create(
name="Invoice Processing",
template_id="tpl_invoice"
)

# Upload a document
doc = client.documents.upload(
project_id=project["id"],
file_path="invoice.pdf"
)

# Run extraction
job = client.extraction.run(project_id=project["id"])
completed = client.extraction.wait_for_completion(job["id"])

# Export results
export = client.exports.create(
project_id=project["id"],
format="csv"
)
csv_data = client.exports.download(export["export"]["id"])

Features

  • Simple API - Intuitive methods matching the REST API
  • Type hints - Full type annotations for IDE support
  • Error handling - Specific exception classes for different errors
  • Webhook support - Built-in signature verification

Resources