DocuProx Python SDK
Official Python package to interact with the DocuProx API for processing documents using templates. Easily integrate AI-powered document extraction into your Python applications.
Installation
Install the DocuProx Python package using pip:
pip install docuprox
Or add it to your requirements.txt:
docuprox>=1.0.0
Configuration
Create a .env file in your project root with your API credentials:
DOCUPROX_API_URL=https://api.docuprox.com/v1
DOCUPROX_API_KEY=your-api-key-here
Or set environment variables directly:
export DOCUPROX_API_URL=https://api.docuprox.com/v1
export DOCUPROX_API_KEY=your-api-key-here
Quick Start
Get started quickly with the DocuProx client:
from docuprox import Docuprox
# Initialize the client using environment variables
client = Docuprox()
# Or initialize with explicit API key
client = Docuprox(api_key="your-api-key-here")
# Process a file using a template
template_id = "your-template-uuid-here"
result = client.processfile("invoice.pdf", template_id)
print(result)
Usage Examples
Process a Local File
from docuprox import Docuprox
client = Docuprox(api_key="your-api-key")
template_id = "template-uuid-here"
result = client.processfile("document.pdf", template_id)
print(result)
Process Base64 Data
from docuprox import Docuprox
client = Docuprox(api_key="your-api-key")
base64_string = "your_base64_encoded_data_here"
template_id = "template-uuid-here"
result = client.processbase64(base64_string, template_id)
print(result)
Using Custom API URL
from docuprox import Docuprox
client = Docuprox(
api_url="https://your-custom-api.com/v1",
api_key="your-api-key"
)
result = client.processfile("file.pdf", "template-id")
print(result)
Error Handling
from docuprox import Docuprox
client = Docuprox(api_key="your-api-key")
try:
result = client.processfile("file.pdf", "template-id")
print(result)
except ValueError as e:
print(f"Processing error: {str(e)}")
Key Features
Simple Integration
Easily connect your Python apps to DocuProx with minimal setup
Flexible Input Options
Supports both file uploads and base64 encoded data
Template Based Extraction
Use predefined templates for accurate structured data extraction
Robust Error Handling
Clear exceptions and validation for smooth development