https://github.com/owainkenwayucl/tesserapy
Minimal Python bindings for Tesseract with CFFI
https://github.com/owainkenwayucl/tesserapy
cffi pillow python3 tesseract-ocr
Last synced: 5 months ago
JSON representation
Minimal Python bindings for Tesseract with CFFI
- Host: GitHub
- URL: https://github.com/owainkenwayucl/tesserapy
- Owner: owainkenwayucl
- License: mit
- Created: 2025-11-23T18:40:00.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-23T19:42:04.000Z (8 months ago)
- Last Synced: 2025-11-23T21:09:39.349Z (8 months ago)
- Topics: cffi, pillow, python3, tesseract-ocr
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TesseraPy
TesseraPy provides a minimal wrapper for HP/Google's Tesseract OCR library, making use of CFFI instead of running the `tesseract` executable like other Python wrappers.
Currently (v0.1.4), it is extremely minimal having a class called `tesseract` with a single method `get_text()` which takes a PIL image as an argument and returns the text in the image.
So e.g.
```python
import TesseraPy
from PIL import Image
i = Image.open("test.png")
t = TesseraPy.tesseract()
txt = t.get_text(i)
print(txt)
```
## Installation
```
pip install git+https://github.com/owainkenwayucl/TesseraPy
```
To install a specific version, e.g. the first release, v0.1.4
```
pip install git+https://github.com/owainkenwayucl/TesseraPy.git@v0.1.4
```
## Configuration
You can control where TesseraPy looks for the various parts of Tesseract with the following environment variable:
* `TESSERACT_LIBRARY` - path to the Tesseract library - default: `/lib64/libtesseract.so.5.3.4`
* `TESSERACT_DATA` - path to Tesseract data files - default: `/usr/share/tesseract/tessdata/`
* `TESSERACT_ENCODING` - encoding - default: `utf-8`
* `TESSERACT_LANGUAGE` - language - default: `eng`
The defaults are those of the development platform - AlmaLinux 10.