pyocr
A Python wrapper for OCR engines (Tesseract, Cuneiform, etc)
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 pyocruv
uv add pyocrpoetry
poetry add pyocrInstalling 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
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
pytesseractPytesseract wraps Google's Tesseract-OCR engine…
permissive · top 1,000 on PyPI
unstructured.pytesseractPython wrapper for Google's Tesseract OCR…
permissive · top 15,000 on PyPI
tesserocrtesserocr wraps Tesseract's C++ OCR engine via…
permissive · top 15,000 on PyPI
easyocrEasyOCR performs optical character recognition…
permissive · top 5,000 on PyPI
ocrmacExtracts text from images on macOS using…
permissive · top 15,000 on PyPI
keras-ocrkeras-ocr detects and recognizes text in images…
permissive · top 15,000 on PyPI
img2tableIdentifies and extracts tables from images and…
permissive · top 15,000 on PyPI
python-doctrpython-doctr extracts and localizes text from…
permissive · top 15,000 on PyPI
perceptronPerceptron is a Python SDK for building…
unclear · top 15,000 on PyPI
amazon-textract-response-parserParses JSON responses from Amazon Textract OCR…
permissive · top 5,000 on PyPI