Skip to main content
PILtesseract
=======
[![](https://img.shields.io/pypi/v/piltesseract.svg?branch=master)](https://pypi.python.org/pypi/piltesseract)

Simple Tesseract wrapper for converting PIL Images to text.

**Warning:** PILtesseract is intended to only work with tesseract 3.03+,
one awesome feature added in 3.03 is the ability to pipe images via stdin,
PILtesseract utilizes this feature.

Features
------------
- Completely wraps [Tesseract-OCR](https://github.com/tesseract-ocr/tesseract) command line optional arguments.
- Sends [PIL](https://pillow.readthedocs.org/en/latest/) images to tesseract through stdin (avoids creating a temp file).
- Works for Python 2 and 3.
- All working code in [one file](https://github.com/Digirolamo/PILtesseract/blob/master/piltesseract/tesseractwrapper.py).
- [MIT License](https://github.com/Digirolamo/PILtesseract/blob/master/LICENSE)
- [Documentation](http://piltesseract.readthedocs.org/en/latest/)

Here is a simple example:


>>> from PIL import Image
>>> from piltesseract import get_text_from_image
>>> image = Image.open('quickfox.png')
>>> get_text_from_image(image)
'The quick brown fox jumps over the lazy dog'

See [Advanced Example](http://piltesseract.readthedocs.org/en/latest/example.html)
See [Recipes](http://piltesseract.readthedocs.org/en/latest/recipes.html)

Requirements
------------
More detailed installation instructions can be found [here](http://piltesseract.readthedocs.org/en/latest/install.html).
- [Tesseract-OCR](https://github.com/tesseract-ocr/tesseract): 3.03 or higher
- First install either from source or from [binaries](https://github.com/tesseract-ocr/tesseract/wiki).
- Ensure that the tesseract binary folder is on your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)).
- [Pillow](https://pillow.readthedocs.org/en/latest/)
- ```$ pip install Pillow```
- [Six](https://pythonhosted.org/six/)
- ```$ pip install six```

Install
------------

$ pip install piltesseract

Release files for piltesseract 1.0.2

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

Source distribution (sdist)

Source distribution for piltesseract 1.0.2
File Size Uploaded
piltesseract-1.0.2.zip 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for piltesseract 1.0.2
File Interpreter ABI Platform
piltesseract-1.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 18.6 kB

Release files / piltesseract-1.0.2.zip

Download URL piltesseract-1.0.2.zip
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7844d871c83001d531a877e2c520e9245809e7f53c72e4129d71f416d3fdee72
BLAKE2b-256 checksum
How to use checksums
80307388812e2bd43a3a65ce4c01651dbe1a7870d0bd07a79f4a4b0fcd9330a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / piltesseract-1.0.2-py2.py3-none-any.whl

Download URL piltesseract-1.0.2-py2.py3-none-any.whl
Size 8.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
66a5899e6534c7d3c576bdb25bdaf8bb2395afaa0738ea80a79fc46cb32ecc77
BLAKE2b-256 checksum
How to use checksums
f801e0c84b75b70c1ed28c8fd7fbe50369a8f8f98adc9fe5b41150f9809bbc6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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