OE
v0.8.0 | optional extras, CLI batch, retry parity

Structured Extraction

Typed output from any media.

Extract structured data from documents, images, audio, and video using LLMs and Pydantic schemas.

View Source
Terminal install
$ uv add openextract
$ openextract report.pdf \
    --schema mypkg:Invoice \
    --model xai:grok-4.3
{ "total": 1240.00, "currency": "USD", ... }
Pydantic Any LLM

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.

1

Define a schema

Describe the shape you want with a Pydantic model.

2

Point at any media

Documents, images, audio, or video via URL.

3

Get typed output

Validated against your schema. No parsing, no regex.

Terminal extract.py
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

Full changelog
v0.8.0 · Install

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].

[openai] [anthropic] [google] [bedrock] [groq] [mistral] [all]

Works with any media

Documents Images Audio Video

PDF, DOCX, PNG, JPG, MP3, MP4, and 20+ formats