Skip to main content

PyPI version CI Status License: MIT

ocrguru

ocrguru is a lightweight, extensible CLI tool that wraps the powerful Docling OCR pipeline.
Process scanned PDFs or images in one command, choose your OCR engine, and export clean text in Markdown, JSON, or hOCR—all without the usual setup fuss.


📖 Table of Contents

  1. ✨ Features
  2. 🚀 Installation
  3. ⚡ Quick Start
  4. 🛠️ CLI Reference
  5. 🎯 Examples
  6. 📂 Project Structure
  7. 🤝 Contributing
  8. ✅ Testing
  9. 📜 License

✨ Features

  • Multiple Engines

    • RapidOCR (default ONNX-based)
    • EasyOCR (PyTorch-powered)
    • Tesseract (Python wrapper or CLI)
  • Input Formats

    • .pdf, .png, .jpg/.jpeg, .tiff, .bmp
  • Output Formats

    • Markdown (.md) – human-friendly
    • JSON (.json) – full coordinates & metadata
    • hOCR (.html) – preserve layout & styling
  • Zero-Config Defaults

    • RapidOCR models auto-download from Hugging Face & cache locally
  • Cross-Platform

    • Works on Windows, macOS, and Linux
  • Extensible Codebase

    • Core logic lives in core.py
    • CLI interface in cli.py
    • Easily add new engines or pipeline options

🚀 Installation

From PyPI:

pip install ocrguru

From your GitHub clone:

git clone https://github.com/yourusername/ocrguru.git
cd ocrguru
pip install .

Note:

  • docling and huggingface-hub will install automatically.
  • For GPU-accelerated EasyOCR, install PyTorch with CUDA support:
    pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu118
    

⚡ Quick Start

Perform OCR on a PDF using the default RapidOCR engine, export to Markdown:

docling-ocr   --engine rapidocr   --input ./scanned_document.pdf   --format md   --output ./scanned_document.md

No extra flags needed!


🛠️ CLI Reference

Usage: docling-ocr [OPTIONS]

Options:
  -e, --engine [easyocr|tesseract_py|tesseract_cli|rapidocr]
                                  OCR engine (default: rapidocr)
  -i, --input PATH                 Input file path (.pdf, image)
  -f, --format [md|json|html]      Output format (default: md)
  -o, --output PATH                Output file path
  -h, --help                       Show this message and exit

🎯 Examples

1. EasyOCR on an Image

docling-ocr   --engine easyocr   --input invoice.jpg   --format json   --output invoice.json

2. Tesseract CLI on PDF → hOCR

docling-ocr   --engine tesseract_cli   --input contract.pdf   --format html   --output contract.hocr.html

3. Batch Processing (RapidOCR default)

for pdf in reports/*.pdf; do
  out="${pdf%.pdf}.md"
  docling-ocr     --input "$pdf"     --output "$out"
done

📂 Project Structure

ocrguru/
├── src/
│   └── ocrguru/
│       ├── cli.py        # CLI entry point
│       └── core.py       # OCR conversion logic
├── tests/                # pytest test suite
├── pyproject.toml        # build & metadata
└── README.md             # this file

🤝 Contributing

We welcome your ideas and pull requests!

  1. Fork the repo & create a feature branch
  2. Install dev dependencies:
    pip install -e .[test]
    
  3. Write tests in tests/ and implement your feature in src/ocrguru/
  4. Run the test suite:
    pytest
    
  5. Open a pull request against main

Please adhere to PEP 8 and write clear commit messages.


✅ Testing

We use pytest for automated testing. Coverage reporting is encouraged:

pytest --cov=ocrguru

Ensure new features include corresponding tests.


📜 License

Released under the MIT License. See LICENSE for full text.


❤️ Happy OCR’ing with ocrguru! ❤️

Metadata

Release files for ocrguru 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocrguru 0.1.0
File Size Uploaded Provenance
ocrguru-0.1.0.tar.gz 5.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ocrguru 0.1.0
File Interpreter ABI Platform
ocrguru-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / ocrguru-0.1.0.tar.gz

Download URL ocrguru-0.1.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f5aa03dfcd6a8407b292c4d90792fdd2b5232af98388440527a9019c34ccbeae
BLAKE2b-256 checksum
How to use checksums
9887ad77ff3f2539761225f337227dbf20f81455afdfa4e45f487b103730edc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release files / ocrguru-0.1.0-py3-none-any.whl

Download URL ocrguru-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c99ad04c8b84113b300dae010bb5a4912969ff8d13632f3fd303eb42e8d4bdb9
BLAKE2b-256 checksum
How to use checksums
a4bcc73bad133ecf2f48eb652fbae923f8d5a53e535204d07ce492fb47e82f87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Security for ocrguru 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page