Skip to main content

UniOCR Logo

One API. Multiple engines. Zero friction.

CI PyPI Docker License 中文文档


UniOCR is a unified, multilingual OCR abstraction layer that wraps best-in-class OCR engines behind a single, clean interface. Throw any image or PDF at it — get back structured text, Markdown, and layout blocks — regardless of which engine runs under the hood.

Built for developers, AI agents, and automation pipelines (n8n, Dify, Telegram bots, etc.).

✨ Key Features

UniOCR Web Dashboard

UniOCR Hardware Radar
  • 🖥️ Stunning Enterprise Dashboard — A fully re-engineered Glassmorphism Web UI featuring an interactive OCR playground, API generator, and live system monitoring.
  • 📊 Geek-Level Hardware Radar — Real-time backend polling of physical sensor data: CPU/GPU frequencies, RAM/Swap allocation, Apple Neural Engine status, and active AI model library versions.
  • 🔐 Military-Grade Security — Built-in local SQLite persistence. Full support for 2FA (TOTP), Admin master passwords, and one-click toggles between public/private API access.
  • 🔑 Seamless API Key Management — Issue and revoke API Tokens directly from the UI, with auto-generated ready-to-use curl snippets for instant integration testing.
  • 🔌 Pluggable Engines — PaddleOCR-VL (deep document AI) and Apple Vision (native macOS) with automatic priority fallback.
  • Zero-Config Acceleration — Auto-detects Apple Silicon → launches MLX-VLM → offloads to Neural Engine (NPU).
  • 🚀 Zero-Delay Smart Cache (LRU) — Instantaneous format switching (TXT, JSON, MD, PDF download/preview) for recent files without re-running the neural network.
  • 🐳 Docker Ready — Single-command deployment via Docker Compose for production-grade frontend & backend.

🚀 Quick Start

Option 1: pip install

# Core only (lightweight)
pip install uniocr

# With PaddleOCR-VL (powerful document AI, ~1.8 GB model download on first run)
pip install "uniocr[paddle]"

# With Apple Vision (macOS only, uses built-in system OCR)
pip install "uniocr[apple]"

# Everything (Recommended for Dashboard & API)
pip install "uniocr[all]"

Option 2: Docker (recommended for servers)

# Use Docker Compose (pulls and runs all components instantly)
curl -O https://raw.githubusercontent.com/yuanweize/uni-ocr/master/docker-compose.yml
docker compose up -d

# Check it's running
curl http://localhost:8000/health

📖 Usage

Python SDK

from uniocr import UniOCR

ocr = UniOCR(engine="auto")          # Auto-selects best available engine
doc = ocr.extract("invoice.pdf")

print(doc.text)                       # Plain text
print(doc.markdown)                   # Structured Markdown
print(doc.to_dict())                  # JSON-serialisable dict

CLI

# Start the full Web UI Console & API server
uniocr serve --port 8000

# Extract text (outputs Markdown by default)
uniocr extract document.pdf -o result.md

# Generate a Searchable PDF
uniocr extract input_image.jpg -o output_searchable.pdf

REST API & Dashboard Console

Start the server:

uniocr serve --port 8000
  • Web UI Console: http://localhost:8000/
  • System Settings & Radar: http://localhost:8000/settings
  • Interactive API Docs: http://localhost:8000/docs

Endpoints

Method Endpoint Description
GET /health Health check & engine list
POST /extract Extract text from uploaded file (JSON/Markdown)
POST /extract/pdf Extract text and return a Searchable PDF file
POST /extract/url Extract text from URL

(If Public API Access is disabled, these endpoints require an Authorization: Bearer <API_KEY> header).

🐳 Docker Build

git clone https://github.com/yuanweize/uni-ocr.git
cd uni-ocr
docker compose up -d --build

🔧 Engine Priority

Priority Engine Best for Speed
1 PaddleOCR-VL + MLX-VLM Complex layouts, tables, formulas, 109 languages ⚡⚡
2 PaddleOCR-VL (CPU) Same capabilities, without MLX acceleration
3 Apple Vision Simple text, macOS only, instant ⚡⚡⚡

Apple Silicon users: when mlx-vlm is installed, UniOCR automatically starts an MLX-VLM server for Neural Engine acceleration. No configuration needed.

📄 License

MIT © 2026 Weize Yuan

Download files

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

Source Distribution

uniocr-3.1.0.tar.gz (208.7 kB view details)

Uploaded Source

Built Distribution

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

uniocr-3.1.0-py3-none-any.whl (221.1 kB view details)

Uploaded Python 3

File details

Details for the file uniocr-3.1.0.tar.gz.

File metadata

  • Download URL: uniocr-3.1.0.tar.gz
  • Upload date:
  • Size: 208.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uniocr-3.1.0.tar.gz
Algorithm Hash digest
SHA256 ec20edca321d967e97c9ecea13a0fdc5a17a7e0929e3770cb23aeba1e05b4682
MD5 4bbacea950c6c8f09dcfedf8b427543e
BLAKE2b-256 cb25e3783b5ee39072b66fd53a0efd6eca8647e7ed6f95881c2b272fc6b2ebd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniocr-3.1.0.tar.gz:

Publisher: publish.yml on yuanweize/uni-ocr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniocr-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: uniocr-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 221.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uniocr-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fbea1bf51544d70df5c113b7e4d9e1ce5a50d262fd992bf15ddcb013d7f6e4b
MD5 3a37f6f46f78f1b47e18e88a86348adb
BLAKE2b-256 57edddc98904b8eba53e01adb855a6bfbd9fddc47a8fe7d08574b3b4c2573697

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniocr-3.1.0-py3-none-any.whl:

Publisher: publish.yml on yuanweize/uni-ocr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

3.1.1

2 files

This release

3.1.0 This release

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page