Skip to main content

Add your description here

Project description

Regia AI SDK

PyPI version

A lightweight Python SDK to interact with the Regia Vision Extractor API.
Send PDF documents and automatically extract structured data using Pydantic schemas.


📦 Installation

pip install regia-ai-sdk

🚀 Quickstart

from regia_ai_sdk 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.5.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.5.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: regia_ai_sdk-0.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 0504efefb0424b9e54edb33b768cba95272246925a93fb9dab542ca1fdbbba23
MD5 f80d63d17c9b3d0b2396eead62b5e3f8
BLAKE2b-256 230ab266102fe533aa59b33f24466709be5e07988845a030ab7c2e7d4a7ffa60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: regia_ai_sdk-0.5.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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88ebe12607300c367d2cc192e9e25a226bf5f9b9681310bbb37e632769c02141
MD5 88bc0b36cc7805e439070270016a8c20
BLAKE2b-256 8294501d97e57894b29077ea85f06c27b9447c0d0af5aa22d104f12c7e845d19

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