skillfed

tesserocr

A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython

tesserocr v2.11.0 562.5K downloads/30d#5,988 on PyPI2,171
Permissive license MIT Active released

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 tesserocr

uv

uv add tesserocr

poetry

poetry add tesserocr

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: POSIXProgramming Language :: CythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Multimedia :: Graphics :: Capture :: ScannersTopic :: Multimedia :: Graphics :: Graphics ConversionTopic :: Scientific/Engineering :: Image Recognition

Tags

optical character recognition OCRextract text from imagestesseract python wrapperimage to text conversionconcurrent OCR processingpillow image recognitiondocument text extraction
ocrimage-processingconcurrent

More Image Recognition packages