Structured Extraction
Typed output from any media.
Extract structured data from documents, images, audio, and video using LLMs and Pydantic schemas.
$ uv add openextract
$ openextract report.pdf \
--schema mypkg:Invoice \
--model xai:grok-4.3
{ "total": 1240.00, "currency": "USD", ... }
Zero Config
One function call. Bring a schema, a URL, and an LLM model string.
Multi-Media
Documents, images, audio, and video with smart routing.
Any LLM
11 providers wired in: OpenAI, Anthropic, Google, AWS Bedrock, xAI, Cohere, Hugging Face, Groq, Mistral, OpenRouter, and Ollama.
Type Safe
Pydantic schemas ensure validated, typed output every time.
How it works
Schema in, typed data out
Define a BaseModel, call extract(), get validated output.
Define a schema
Describe the shape you want with a Pydantic model.
Point at any media
Documents, images, audio, or video via URL.
Get typed output
Validated against your schema. No parsing, no regex.
from pydantic import BaseModel
from openextract import extract
class Report(BaseModel):
title: str
findings: list[str]
severity: int
result = extract(
schema=Report,
model="xai:grok-4.3",
input_file="https://example.com/report.pdf",
instructions="Extract findings",
)
What’s new
v0.8.0
Slim core, optional provider extras
pip install openextract and uv add openextract ship a lean dependency set. Add the SDK you need for model calls — for example openextract[openai] or openextract[all].
Works with any media
PDF, DOCX, PNG, JPG, MP3, MP4, and 20+ formats