Add your description here
Project description
Regia AI SDK
A lightweight Python SDK to interact with the Regia Vision Extractor API.
Send PDF documents and automatically extract structured data using Pydantic schemas.
📦 Installation
Using pip:
pip install regia-ai-sdk
or uv use the command line:
uv add regia-ai-sdk
🚀 Quickstart
from regia_ai_sdk.vision import VisionClient
from pydantic import BaseModel, Field
import os
class InvoiceModel(BaseModel):
due_date: str = Field(..., description="The due date of the invoice")
total_amount: float = Field(..., description="The total amount of the invoice")
token = os.getenv("API_TOKEN")
client = VisionClient(token=token)
result = client.extract("./data/sample.pdf", InvoiceModel)
print(result)
📂 Other Input Methods
From bytes
with open("./data/sample.pdf", "rb") as f:
content_bytes = f.read()
result = client.extract(content_bytes, InvoiceModel, filename="sample_bytes.pdf")
print(result)
From base64
import base64
with open("./data/sample.pdf", "rb") as f:
base64_string = base64.b64encode(f.read()).decode("utf-8")
result = client.extract(base64_string, InvoiceModel, filename="sample_base64.pdf")
print(result)
🧠 Features
- ✅ Simple interface for sending documents to the Regia Vision API
- ✅ Supports file path, bytes, and base64 inputs
- ✅ Use Pydantic models to define the expected data
- ✅ Automatically converts Pydantic to schema JSON
🔐 Authentication
You must provide an API token and base URL:
export API_TOKEN=your_api_token_here
Made with 💡 by Regia.ai
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
regia_ai_sdk-0.7.2.tar.gz
(2.9 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 regia_ai_sdk-0.7.2.tar.gz.
File metadata
- Download URL: regia_ai_sdk-0.7.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dac067b5c93ac34f94f0729e1a403a0fd4265831d9faa302febaaf96ae07f66
|
|
| MD5 |
91a8ab3eb8fede4ef4a56244de227930
|
|
| BLAKE2b-256 |
053ebacfda125ca9a09bc2c45053fd9c3ee366e62810e4f414d39a3f6e73c25a
|
File details
Details for the file regia_ai_sdk-0.7.2-py3-none-any.whl.
File metadata
- Download URL: regia_ai_sdk-0.7.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef8ed60c5146adf5ef010c51cf3f62c39c54b0c167d937119e99f77f5ced885
|
|
| MD5 |
5ad9d35ff959c64d66b1886653528022
|
|
| BLAKE2b-256 |
1e0a14cc8f6a6fb838aba7a8308975f09e5ab9939cf0e4c39bc14b7e69b848cb
|