CatchTheTornado

text-extract-api: Extract Text and Data from Documents

A self-hostable API that turns PDFs, images, and Office files into Markdown or structured JSON using OCR and Ollama models. It suits teams that need document processing and PII removal with control over where files are processed.

View on GitHub Compare
Stars
3.2k
Forks
279
Stars, last 30 days
+14

Our take

Health score

28/100

How it is scored
Activity
19
Community
52
Issues
21
Pull requests
20

+14 stars in the last 30 days

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

3,198

Forks

280

Change since Nov 17, 2026: 0 stars·0 forks

Overview

text-extract-api is a Python service for extracting text and structured data from PDFs, images, and Office documents. It combines OCR strategies with optional Ollama model processing to produce Markdown or JSON, including for documents with tables, numbers, or formulas.

It is designed for teams that want to run document processing in their own environment rather than send files to an external OCR service. Optional asynchronous processing, caching, and storage profiles support integration into document workflows.

Key Features

  • Accepts PDFs, images, and Office documents through HTTP API endpoints or a CLI.
  • Converts documents to Markdown or structured JSON.
  • Offers EasyOCR, MiniCPM-V, Llama Vision, and configurable remote OCR strategies.
  • Uses Ollama models to transform or refine OCR output, including with custom prompts.
  • Supports prompts for removing personally identifiable information from extracted content.
  • Processes tasks asynchronously with Celery and uses Redis for OCR-result caching.
  • Saves results through configurable storage profiles, including local files, Google Drive, and Amazon S3.

Use Cases

  • A document-processing team can extract invoice fields into JSON for downstream systems.
  • Healthcare or administrative teams can convert reports to Markdown and apply prompt-based PII removal before using the output.
  • Developers can add OCR to an application through the API, CLI, or provided TypeScript client.
  • Organizations handling sensitive files can deploy the service on their own infrastructure and configure where results are stored.

Getting Started

Clone the repository and start its Docker Compose services:

git clone https://github.com/CatchTheTornado/text-extract-api.git
cd text-extract-api
docker-compose up --build

Docker, Docker Compose, and Ollama are among the documented prerequisites. See the README for configuration, GPU options, native setup, and API usage.

Alternatives

  • unstructured: Unstructured is a document-parsing library rather than an API, and produces structured elements for downstream workflows.
  • marker: Marker focuses on document conversion with local models and inference backends, rather than an API centered on OCR and PII removal.
  • OmniParse: OmniParse also handles audio, video, and web pages, but requires Linux and a GPU with at least 8–10 GB of VRAM.
  • docling: Docling is a document-conversion library with structured exports and local processing, rather than an OCR API with PII removal.
ProjectLanguageLicenseStarsStatus
text-extract-apiPythonMIT3.2kNot checked yet
unstructuredHTMLApache-2.015.5kActive
markerPythonApache-2.040.2kActive
OmniParsePythonGPL-3.07.9kQuiet
doclingPythonMIT69.6kActive

Considerations

  • Running locally requires managing supporting services and model downloads. The documented stack includes FastAPI, Celery, Redis, and Ollama.
  • OCR strategy, language, and model choice can affect processing results and resource needs. The README describes Llama Vision as the slowest strategy.
  • The remote Marker option requires a separately installed service. Its licensing and model-weight terms differ from the project's MIT license, so check those terms before use.
  • PII removal is prompt-based document processing. The repository description does not establish it as a guaranteed compliance or anonymization control.

Found this useful?

Share it with someone who would like text-extract-api.

Comparisons