AI Card Bao CACTI.AICARDBAO.COM
Home / open source / ExtractThinker
AI TOOL / #12919

ExtractThinker

An intelligent documentation library designed for LLMs, offering ORM-style interactions to create flexible and powerful documentation workflows.

Introduction

ExtractThinker is an open-source Python library for turning documents into typed data. Define a Pydantic contract, choose a document parser and LLM, then load, classify, split and extract.

Documentation · Quickstart · Contributing · 2026 roadmap

First extraction

pip install extract-thinker

Set EXTRACT_THINKER_MODEL to a model available to you and configure that provider's API key. Save this sample as invoice.txt:

Invoice: INV-2026-001
Supplier: Example Company
Total: 120.00 EUR
import os
from pydantic import Field
from extract_thinker import Contract, DocumentLoaderTxt, Extractor, LLM

class Invoice(Contract):
    invoice_number: str
    supplier: str
    total: float = Field(ge=0)
    currency: str

extractor = Extractor(
    DocumentLoaderTxt(),
    LLM(os.environ["EXTRACT_THINKER_MODEL"], token_limit=1000),
)
result = extractor.extract("invoice.txt", Invoice)
print(result.model_dump())

The result is a validated Invoice. Schema validity does not guarantee factual accuracy; evaluate results on your documents. Extraction uses the configured provider and may incur charges.

For PDFs, install pypdf and use DocumentLoaderPyPdf. Scanned documents need OCR or a vision-capable model. System MIME detection requires libmagic (brew install libmagic on macOS or apt-get install libmagic1 on Debian/Ubuntu). See the quickstart for a credential-free loading check and setup details.

Build a document workflow

NeedComponent
Read PDFs, images, tables and spreadsheetsDocument loaders
Define fields, constraints and post-validationPydantic contracts
Classify and split mixed document bundlesClassification and splitters
Handle long inputs and incomplete responsesCompletion strategies
Use local modelsOllama setup

2026 additions on main

The repository now includes page retrieval with SQLite, parallel field extraction, configurable model routing, local entity masking, page events, PyMuPDF/Camelot/Tabula/Adobe loaders, and an MCP service with Docker Compose. These changes are not yet a new PyPI release. Install from a checkout to use them:

git clone https://github.com/enoch3712/ExtractThinker.git
cd ExtractThinker
pip install -e .

Read the 2026 update and compatibility notes, MCP setup, and issue-resolution evidence. The core supports Python 3.9–3.13; the optional MCP service requires Python 3.10+.

Contribute

Start with CONTRIBUTING.md. The offline core suite runs without provider credentials. Good contributions include reduced document fixtures, loader compatibility fixes, examples with expected outputs, and clear reports of model or parser limitations.

If ExtractThinker helps your project, a GitHub star helps others find it. The roadmap focuses on reliable onboarding, reproducible examples and contributor support.

Articles and project history

Stay updated and connect with the community:

License

Apache License 2.0.

Visits:64 Updated:2026-12-05 AI tools

Related

3D Reading 3D Yueyue – A free online 3D image viewing software; allows users to view STEP/STP models on mobile devices. Features lightweight processing of 3D models and online drawing review capabilities. 3D Yueyue: a 3D model visualization tool with advanced lightweighting technologies. Species 2000 China, Catalogue of Life China, CoL China: The Species 2000 China initiative, as part of the Chinese Biodiversity Database. Our goal is to provide online information about the animals, plants, fungi, and microorganisms that are known in China. Pen-point navigation Bidian is a customizable and user-friendly website navigation tool that allows for the creation of custom categories and quick access links. OpenStreetMap: an open-source map project OpenStreetMap is a world map that is jointly created by people just like you, and it can be used freely in accordance with the open license agreement. 3DMGAME Single-player Game Forum The 3DMGAME forum is a domestic community dedicated to single-player games, providing PC players with information about various games, as well as opportunities to discuss localization efforts and share resources. Learning and Query System for the Five Elements and Six Qi Theories Based on the mathematical principles of Li Yangbo's Yin-Yang theory and drawing on classics such as the "Seven Chapters on Qi Movement" in the "Huangdi Neijing," it is possible to calculate a person’s birth chart, analyze the five elements and six qi forces during a specific year, and determine the health-related fortunes associated with these factors in that year. For those whose birthdays are in the Gregorian calendar, the system can automatically convert them into the traditional Chinese lunar date system, including the Heavenly Stems and Earthly Branches as well as the zodiac sign.