The client.processors module provides a powerful, production-grade system for configuring and managing document extraction workflows. Processors define what to extract and how to extract it, creating reusable configurations that can be triggered on-demand or automated through various channels.
Processors eliminate the complexity of manually configuring extraction parameters for each document, allowing you to focus on defining your output schema and reusing proven configurations across multiple documents and automation workflows.
Method
Purpose
create
Creates a new processor configuration with specified extraction parameters.
submit
Processes documents using an existing processor and returns structured JSON.
Creates a new processor with the specified extraction configuration. The processor can then be used repeatedly to extract structured data from documents.
Processes one or more documents using an existing processor configuration and returns the extracted structured data. This is the primary method for executing document extraction.
The extracted data as a JSON object matching the processor’s schema.
Copy
from retab import Retab, MIMEDatareclient = Retab()# Process a single documentwith open("invoice.pdf", "rb") as f: mime = MIMEData.from_bytes(f.read(), filename="invoice.pdf")completion = reclient.processors.submit( processor_id="proc_01G34H8J2K", document=mime)