landing-ai/ade-python

Python library for Agentic Document Extraction (ADE).

What it solves

This library provides a programmatic way to convert unstructured documents (PDFs and images) into structured, machine-readable data. It solves the problem of extracting specific, typed information from complex documents while maintaining a link (grounding) between the extracted text and its original location in the document.

How it works

The library interfaces with the LandingAI Agentic Document Extraction (ADE) API. It follows a two-step process:

  1. Parse: It converts a document into structured Markdown, creating a structure tree that includes pixel-coordinate bounding boxes (grounding) for every element.
  2. Extract: It uses a schema (defined via Pydantic models, dictionaries, or JSON) to pull specific typed fields out of the generated Markdown.

For large documents, the library supports asynchronous jobs with polling and wait helpers to prevent timeouts.

Who it’s for

It is designed for developers building applications that need to automate data entry from PDFs or images, such as invoice processing, identity verification, or any workflow requiring structured data extraction from visual documents.

Highlights

  • Typed Responses: Uses Pydantic models for fully typed requests and responses.
  • Grounding: Provides pixel-coordinate bounding boxes for document elements to ensure data is grounded in the source.
  • Flexible Extraction: Supports Pydantic, dict, or JSON schemas for field extraction.
  • Async Support: Includes both sync and async clients, with optional aiohttp backend for high concurrency.
  • Job Management: Built-in helpers for managing long-running extraction jobs for large files.

Related

  • Project
  • Project
  • Project
  • Project
  • Project