Skip to main content

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 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")

base_url = os.getenv("BASE_URL")
token = os.getenv("API_TOKEN")

client = VisionClient(token=token, base_url=base_url)

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 BASE_URL=https://your-api-url.com
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.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

regia_ai_sdk-0.7.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file regia_ai_sdk-0.7.0.tar.gz.

File metadata

  • Download URL: regia_ai_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for regia_ai_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 267c748d7bc226a47831c54871230ec455e523d268084306a43b058175f40805
MD5 f9573fe9daa855a47e8d1d3656cf3a81
BLAKE2b-256 bb2ee8d4de8b8bd5dcf58439b37d2695ed9a4009c625f566c6c4c044f2eeaf1d

See more details on using hashes here.

File details

Details for the file regia_ai_sdk-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: regia_ai_sdk-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for regia_ai_sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1531f0e35c2542eada484e44a323ea7107b41218a942780581056cf70766bb
MD5 e73f5dc6088b9595d71e7e29e1455069
BLAKE2b-256 a8ef73d0f32bb337b798c27ca4c83d52144186ae1023b25a8af7227591eda8bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page