Skip to main content

No project description provided

Project description

tess_py_api

Python wrapper around Tesseract-OCR C language API using Python built-in ctypes module.

tess_py_api is much faster than pytesseract when dealing with more than one image and lets Python developers use all of the Tesseract library functionality using the auto-generated Python base wrapper.

INSTALLATION

me@home:~$ pip install tess_py_api

To use this module you need to have Tesseract installed.

For Windows users, Tesseract-OCR executable can be downloaded from here (note that you will need to add Tesseract to your path).

For Linux users, you can compile Tesseract from source or get it via your package manager (note that you will need to add an enviroment variable called TESSDATA_PREFIX pointing to your tessdata directory).

USAGE

from tess_py_api import Pyapi

api = Pyapi("eng")

image_path = "/path/to/image"
print(api.image_to_string(image_path))
  

if you have OpenCV installed you can use it:

import cv2 as cv
from tess_py_api import Pyapi

api = Pyapi("eng")

image = cv.imread("path/to/image")

print(api.image_to_string(image))

or you can use python built-in PIL/pillow:

from PIL import Image
from tess_py_api import Pyapi

api = Pyapi("eng")

image = Image.open("path/to/image")

print(api.image_to_string(image)

Python context manager is also supported:

from tess_py_api import Pyapi

with Pyapi("eng") as api:
  print(api.image_to_string("/path/to/image"))

LICENSE

This repository is under the MIT license. The repository wraps code under the Apache 2.0 license for Tesseract.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tess_py_api-0.0.12-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file tess_py_api-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: tess_py_api-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for tess_py_api-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 95400af5b178212d1051c5e7b5ef0ce787d3ab5da1dde70198ba184cf6cef44b
MD5 64b9a12309beb4ba8ed05881ef694b0a
BLAKE2b-256 0a57ebfa17d3c0c6eb010241d118ef124522a35f31a85fff28b9f2ae69ae6a7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page