tesserocr
A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
What it is and what it does
tesserocr is a Python wrapper around the Tesseract OCR engine, built with Cython to provide direct access to Tesseract's C++ API. It extracts text and metadata from images, supporting both file paths and Pillow Image objects. The package is designed for concurrent use with Python's threading module, releasing the GIL during image processing to enable true parallel execution.
The library exposes both high-level convenience functions (like `image_to_text()` and `file_to_text()`) and a lower-level API (`PyTessBaseAPI`) for advanced use cases such as component detection, orientation/script detection, and per-symbol confidence scores. It requires system libraries libtesseract and libleptonica to be installed separately on Unix-like systems, though Windows wheels bundle these dependencies.
Use it for:
- Batch processing scanned documents or photographs to extract searchable text for archival systems
- Building concurrent image-to-text pipelines that leverage threading for high-throughput OCR workflows
- Detecting document orientation and script language before applying language-specific OCR models
- Extracting text regions with per-character confidence scores for quality control in document processing
- Integrating OCR into data pipelines that already use Pillow for image manipulation
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
tesserocr wraps Tesseract's C++ OCR engine via Cython, extracting text and metadata from images with support for Pillow objects and concurrent processing through Python's threading module.
Yes, if you need OCR and can install system libraries. tesserocr is actively maintained, production-stable, has no known vulnerabilities, and offers genuine concurrency advantages over pure-Python OCR libraries. The medium install friction (external C++ dependencies) is the main trade-off; Windows users should use Conda or pre-built wheels to avoid compilation.
Install
tesserocr on PyPI
pip
pip install tesserocruv
uv add tesserocrpoetry
poetry add tesserocrInstalling tesserocr
Before you install
Medium install friction due to compiled C++ dependencies. Requires libtesseract (>=3.04) and libleptonica (>=1.71) to be installed separately on Linux/macOS, or pre-packaged wheels on Windows. Package is actively maintained with recent releases and builds available for Python 3.9–3.14 across multiple platforms.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install tesserocr
from tesserocr import PyTessBaseAPI
with PyTessBaseAPI() as api:
api.SetImageFile('sample.jpg')
print(api.GetUTF8Text())
Requires libtesseract (>=3.04) and libleptonica (>=1.71) libraries installed on the system; on Linux/Ubuntu install via apt-get, on macOS via Homebrew, or use Conda on Windows.
Verify before relying
- Whether traineddata files are bundled or must be downloaded separately for language support
- Performance characteristics when processing large batches of images
- Compatibility with PyPy implementation beyond CPython
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — cysignals |
| Maintenance | actively maintained — 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 562,527/month — #5,988 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tesserocr-2.11.0-cp310-cp310-macosx_15_0_arm64.whl; tesserocr-2.11.0-cp310-cp310-macosx_15_0_x86_64.whl; tesserocr-2.11.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; tesserocr-2.11.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tesserocr-2.11.0-cp310-cp310-musllinux_1_2_x86_64.whl; tesserocr-2.11.0-cp311-cp311-macosx_15_0_arm64.whl; tesserocr-2.11.0-cp311-cp311-macosx_15_0_x86_64.whl; tesserocr-2.11.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; tesserocr-2.11.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tesserocr-2.11.0-cp311-cp311-musllinux_1_2_x86_64.whl; tesserocr-2.11.0-cp312-cp312-macosx_15_0_arm64.whl; tesserocr-2.11.0-cp312-cp312-macosx_15_0_x86_64.whl; tesserocr-2.11.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; tesserocr-2.11.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tesserocr-2.11.0-cp312-cp312-musllinux_1_2_x86_64.whl; tesserocr-2.11.0-cp313-cp313-macosx_15_0_arm64.whl; tesserocr-2.11.0-cp313-cp313-macosx_15_0_x86_64.whl; tesserocr-2.11.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; tesserocr-2.11.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tesserocr-2.11.0-cp313-cp313-musllinux_1_2_x86_64.whl
Keywords: Tesseract, tesseract-ocr, OCR, optical character recognition, PIL, Pillow, Cython
Tags
More Image Recognition packages
OpenCV Python bindings for computer vision…
permissive · top 1,000 on PyPI
tritonclienttritonclient is a Python client library for…
permissive · top 5,000 on PyPI
torchmetricsTorchmetrics provides a collection of PyTorch…
permissive · top 5,000 on PyPI
pytorch-lightningPyTorch Lightning wraps PyTorch training code…
permissive · top 5,000 on PyPI
opencv-contrib-pythonopencv-contrib-python provides Python bindings…
permissive · top 5,000 on PyPI
ultralyticsUltralytics YOLO provides a unified framework…
agpl · top 5,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
ocrmypdfOCRmyPDF adds searchable text layers to scanned…
copyleft · top 5,000 on PyPI
pyocrPyOCR wraps multiple OCR engines (Tesseract,…
copyleft · top 15,000 on PyPI
keras-ocrkeras-ocr detects and recognizes text in images…
permissive · top 15,000 on PyPI
ocrmacExtracts text from images on macOS using…
permissive · top 15,000 on PyPI
perceptronPerceptron is a Python SDK for building…
unclear · top 15,000 on PyPI
easyocrEasyOCR performs optical character recognition…
permissive · top 5,000 on PyPI
kreuzbergExtracts text, tables, images, and metadata…
permissive · top 15,000 on PyPI
ManimPangoManimPango is a C binding for Pango using…
permissive · top 15,000 on PyPI