skillfed

pyocr

A Python wrapper for OCR engines (Tesseract, Cuneiform, etc)

pyocr v0.8.5 77.4K downloads/30d#14,525 on PyPI
Copyleft license GPL-3.0-or-later DORMANT released

What it is and what it does

PyOCR is a Python wrapper that provides a unified interface to multiple OCR engines—Tesseract, libtesseract, and Cuneiform—allowing you to extract text and spatial information from images without writing engine-specific code. It handles image input through Pillow, supporting all formats Pillow supports (jpeg, png, gif, bmp, tiff and others), and returns results in multiple formats: plain text strings, word or line bounding boxes with pixel coordinates, or hOCR markup for structured document representation.

The package is designed for straightforward OCR workflows: detect available engines on the system, choose one, specify a language, and call image_to_string() with your image and desired output builder. It also supports orientation detection and digit-only recognition (Tesseract and libtesseract only) and can generate PDF files from images. However, the project is dormant—last updated 2023-09-17—so it receives no active maintenance, and compatibility with the latest OCR engine versions or Python releases is unverified.

Use it for:

  • Extract text from scanned documents or photographs for indexing or archival
  • Build a document digitization pipeline that converts images to searchable text or hOCR
  • Detect and correct page orientation in batch OCR workflows
  • Extract structured data (word positions, confidence scores) for layout analysis or form processing
  • Generate searchable PDF files from image scans using libtesseract

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyOCR wraps multiple OCR engines (Tesseract, Cuneiform, libtesseract) to extract text and spatial data from images in Python, supporting multiple output formats including plain text, bounding boxes, and hOCR.

Yes, if you need a stable, lightweight OCR wrapper and have an OCR engine already installed. The low install friction and lack of vulnerabilities make it straightforward to add to a project. However, the dormant maintenance status means you should verify compatibility with your target OCR engine version and Python version before committing to it in new projects. The GPL-3.0-or-later license is a hard blocker for proprietary software.

Install

pyocr on PyPI

pip

pip install pyocr

uv

uv add pyocr

poetry

poetry add pyocr

Installing pyocr

Before you install

Low install friction with a single runtime dependency (Pillow). Maintenance is dormant—last release was in 2023-09-17—so expect no active bug fixes or feature updates, though the package remains functional for stable OCR engine backends.

License in practice

Licensed under GPL-3.0-or-later (copyleft). Any derivative work or distribution must also be open-source under a compatible GPL license, which may restrict use in proprietary or closed-source projects.

Quickstart

pip install pyocr

import pyocr
import pyocr.builders

tools = pyocr.get_available_tools()
if tools:
    tool = tools[0]
    txt = tool.image_to_string(
        Image.open('test.png'),
        builder=pyocr.builders.TextBuilder()
    )

Requires an external OCR engine (Tesseract, libtesseract, or Cuneiform) to be installed and available on the system; PyOCR is a wrapper only and will not function without one.

Verify before relying

  • Current compatibility with modern Python versions (3.4+ stated in description, but dormant since 2023)
  • Compatibility with recent Tesseract or libtesseract versions
  • Whether Windows and macOS support (noted as uncertain in description) has improved
  • Whether Image.open() usage requires explicit Pillow import in user code

Package facts

License GPL-3.0-or-later (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — Pillow
Maintenance dormant — 1,062 days since the last release
First released
Downloads 77,433/month — #14,525 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyocr-0.8.5-py3-none-any.whl

Tags

ocr text extraction pythontesseract wrapper pythonimage to text recognitionoptical character recognition libraryextract text from imagesocr bounding boxesdocument text recognition
ocrdocument-processingimage-recognition

More Text Processing packages