Python SDK for the Indox media and document conversion services.
Project description
indox-client
Python SDK for the Indox media and document conversion services.
Installation
pip install indox-client
Quick Start
from indox_client import IndoxClient
# Initialize with API key
client = IndoxClient(api_key="your-api-key")
# Or use environment variables
# export INDOX_API_KEY=your-api-key
client = IndoxClient.from_env()
# Convert a document
result = client.docs.convert_file(
file_path="document.pdf",
target_formats=["docx", "txt"]
)
# Wait for completion
completed = client.docs.wait_for_completion(result["conversion_id"])
# Download the result
client.docs.download(
conversion_id=result["conversion_id"],
output_path="output.docx",
fmt="docx"
)
Features
- Document Conversion: Convert between PDF, DOCX, TXT, and more
- Font Conversion: Convert between TTF, OTF, WOFF, WOFF2, and other font formats
- Media Conversion: Convert images and videos between formats
- Async Support: Long-polling for conversion status
- Multiple Sources: Upload files, URLs, or S3 keys
Usage
Font Conversion
# Convert font formats
result = client.docs.convert_and_download(
file_path="font.ttf",
target_format="woff2",
output_path="font.woff2"
)
# Check supported font formats
formats = client.docs.supported_formats()
print(f"Available formats: {formats['total_formats']}")
# Validate conversion before processing
validation = client.docs.validate(
file_path="font.ttf",
target_format="otf"
)
if validation["valid"]:
print(f"Conversion possible with {validation['engine']} engine")
Media Conversion
# Convert image
result = client.media.convert_image(
file_path="image.png",
target_formats=["webp", "jpg"]
)
# Convert video
result = client.media.convert_video(
file_path="video.mp4",
target_formats=["webm"]
)
# Check supported formats
image_formats = client.media.image_formats()
video_formats = client.media.video_formats()
Context Manager
with IndoxClient.from_env() as client:
result = client.docs.convert_file(
file_path="document.pdf",
target_formats=["docx"]
)
Configuration
| Environment Variable | Description |
|---|---|
INDOX_API_KEY |
Your API key |
INDOX_DOCS_URL |
Docs service URL (default: https://docs.indox.org/) |
INDOX_MEDIA_URL |
Media service URL (default: https://docs.indox.org/) |
Error Handling
from indox_client import IndoxClient, IndoxHTTPError, IndoxClientError
try:
result = client.docs.convert_file(
file_path="document.pdf",
target_formats=["docx"]
)
except IndoxHTTPError as e:
print(f"HTTP {e.status_code}: {e}")
print(f"Request ID: {e.request_id}")
except IndoxClientError as e:
print(f"Client error: {e}")
License
Proprietary - see LICENSE for details.
Additional Documentation
- Font Conversion Guide - Comprehensive guide for font format conversion
- Font API Testing Notebook - Interactive notebook for testing all font conversion endpoints
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
indox_client-0.2.2.tar.gz
(12.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file indox_client-0.2.2.tar.gz.
File metadata
- Download URL: indox_client-0.2.2.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a40953688571c7d5d4446517a3e899866a7cf1cdd2eef94779491ae10a34104
|
|
| MD5 |
608c4909f912b90acef8a230bd23ebcb
|
|
| BLAKE2b-256 |
dfedfb9b739cf6b1f24c1b58501641a9518cddfb375f6d614de163efdef409e8
|
File details
Details for the file indox_client-0.2.2-py3-none-any.whl.
File metadata
- Download URL: indox_client-0.2.2-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
509274a39540fb136b78d241c969b3496a3acd7f9328714ee961f57fc6b8d68f
|
|
| MD5 |
ff4f8557a4f9cc56114531b2d2298f6e
|
|
| BLAKE2b-256 |
1d930abba4019fef1280704d0587d749c046b8c3d1c798536e0c40db18ce42ea
|