Skip to main content

Retab official python library

Project description

Retab

Retab Logo

The AI Automation Platform

Made with love by the team at Retab 🤍.

Our Website | Documentation | Discord | Twitter


What is Retab?

Retab solves all the major challenges in document processing with Large Language Models:

  1. Universal Document Preprocessing: Convert any file type (PDFs, Excel, emails, etc.) into LLM-ready format without writing custom parsers
  2. Structured, Schema-driven Extraction: Get consistent, reliable outputs using schema-based prompt engineering
  3. Processors: Publish a live, stable, shareable document processor.
  4. Automations: Create document processing workflows that can be triggered by events (mailbox, upload link, endpoint, outlook plugin).
  5. Optimizations: Identify the most used processors and help you finetune models to reduce costs and improve performance

We are offering you all the software-defined primitives to build your own document processing solutions. We see it as Stripe for document processing.

Our goal is to make the process of analyzing documents and unstructured data as easy and transparent as possible.

A new, lighter paradigm Large Language Models collapse entire layers of legacy OCR pipelines into a single, elegant abstraction. When a model can read, reason, and structure text natively, we no longer need brittle heuristics, handcrafted parsers, or heavyweight ETL jobs. Instead, we can expose a small, principled API: "give me the document, tell me the schema, and get back structured truth." Complexity evaporates, reliability rises, speed follows, and costs fall—because every component you remove is one that can no longer break. LLM‑first design lets us focus less on plumbing and more on the questions we actually want answered.

Many people haven't yet realized how powerful LLMs have become at document processing tasks - we're here to help unlock these capabilities.


Go further


Code examples

You can check our Github repository to see code examples: python examples and jupyter notebooks.

Workflow Spec

Use client.workflows.spec to validate, plan, apply, and export declarative workflow YAML.

from retab import Retab

client = Retab()

validation = client.workflows.spec.validate(yaml_definition)
plan = client.workflows.spec.plan(yaml_definition)
result = client.workflows.spec.apply(yaml_definition)
exported = client.workflows.spec.get(result.workflow_id)

A declarative spec uses apiVersion: workflows.retab.com/v1alpha2 and explicit edge handles:

edges:
  - from:
      block: start_document-node
      handle: output-file-0
    to:
      block: extract-node
      handle: input-file-source_doc

Workflow Artifacts

Workflow steps expose artifact as a stable {operation, id} pointer. Use client.workflows.artifacts to fetch the persisted record behind that pointer, including review evaluations, conditional matches, function outputs, and API-call attempts. Review decisions live on the review queue APIs; artifact records are for inspecting why a branch or gate fired.

import time

run = client.workflows.runs.create(
    workflow_id="workflow_abc123",
    documents={"start_document-node": "invoice.pdf"},
)

while run.lifecycle.status not in {"completed", "error", "failed", "cancelled"}:
    time.sleep(1)
    run = client.workflows.runs.get(run.id)

steps = client.workflows.steps.list(run_id=run.id)
review_step = next((step for step in steps if step.block_id == "review-node"), None)
if review_step is not None:
    step = client.workflows.steps.get(review_step.step_id, run_id=run.id)

all_artifacts = client.workflows.artifacts.list(run.id)

Community

Let's create the future of document processing together!

Join our discord community to share tips, discuss best practices, and showcase what you build. Or just tweet at us.

We can't wait to see how you'll use Retab.


Roadmap

We share our roadmap publicly on Github

Among the features we're working on:

  • Node.js SDK
  • Schema optimization autopilot
  • Sources API

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retab-0.0.143.tar.gz (129.7 kB view details)

Uploaded Source

Built Distribution

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

retab-0.0.143-py3-none-any.whl (133.5 kB view details)

Uploaded Python 3

File details

Details for the file retab-0.0.143.tar.gz.

File metadata

  • Download URL: retab-0.0.143.tar.gz
  • Upload date:
  • Size: 129.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for retab-0.0.143.tar.gz
Algorithm Hash digest
SHA256 c9c6fe5e8e82b1e753b68ec12fa12e1aadac55e71362e189dd8fdebef6b3f1ed
MD5 ecaaf47391495822b70b1ac896606b98
BLAKE2b-256 e8ed3068cd6d56bc2d02164889f1bf7a1d5a5de97f8bf82d54e6baf9786a6381

See more details on using hashes here.

File details

Details for the file retab-0.0.143-py3-none-any.whl.

File metadata

  • Download URL: retab-0.0.143-py3-none-any.whl
  • Upload date:
  • Size: 133.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for retab-0.0.143-py3-none-any.whl
Algorithm Hash digest
SHA256 3d04d5d157b80e22fdc48526b3e3ec5701fecdc676aaf9de412db103e2a4d2f4
MD5 634c4076a4e0e7e87c3103dadddcceed
BLAKE2b-256 b41fdc9e5e28ea7e47f085c95bf2ff7231d712f565dc981c4b67a676534e0ca0

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