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.11-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tess_py_api-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 11.2 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.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for tess_py_api-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a7f116ac502dadaf061473335c71d259da852937250a6d3c6212bfc3cdd83570
MD5 840a7770d257c53e5a7da2d138e4e260
BLAKE2b-256 4a7a16546eab2f58e78262ec339c6d47fdb3c90eb98c6b5a9237085f4c53c6c0

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