Skip to main content

Tesseract pybind11 bindings

Project description

tessbind

Actions Status

PyPI version PyPI platforms

Python 3.12+ bindings for Tesseract built with pybind11. The package vendors the native dependencies (leptonica, libpng, zlib) so you only need Tesseract's trained data files available at runtime.

Installation

pip install tessbind

Tesseract language data must be discoverable. If it is not installed in a default location (e.g., /usr/share/tesseract-ocr/5/tessdata on Linux or the Homebrew Cellar on macOS), set TESSDATA_PREFIX to the directory that contains the tessdata folder.

Usage

TessbindManager wraps the underlying API in a context manager and exposes the recognized UTF-8 text plus per-word confidences:

from pathlib import Path

from tessbind import PageSegMode, TessbindManager

img_bytes = Path("tests/hello.png").read_bytes()

with TessbindManager(lang="eng", page_seg_mode=PageSegMode.SINGLE_LINE) as tb:
    text, confidences = tb.ocr_image_bytes(img_bytes)

print(text)         # -> Hello, World!
print(confidences)  # list of word-level confidences (0-100)

Use the page_seg_mode setter to change segmentation between calls, or omit it to rely on Tesseract's default.

Development

  • uv sync --extra test to create the venv and build vendored libraries.
  • uv run pytest -m "not slow" to run the test suite.

Project details


Download files

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

Source Distribution

tessbind-1.0.0.tar.gz (18.9 MB view details)

Uploaded Source

Built Distributions

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

tessbind-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tessbind-1.0.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tessbind-1.0.0-cp314-cp314-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

tessbind-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tessbind-1.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tessbind-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tessbind-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tessbind-1.0.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tessbind-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file tessbind-1.0.0.tar.gz.

File metadata

  • Download URL: tessbind-1.0.0.tar.gz
  • Upload date:
  • Size: 18.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tessbind-1.0.0.tar.gz
Algorithm Hash digest
SHA256 81502cf9acd494924ffc48e48c57d2004eb0fe739b2fa644daffa15546da7acf
MD5 2c518d28771849706244968b36b1d8eb
BLAKE2b-256 63549612e16bd9cded9e2f2c4393fe8108344cbac1d74780ab9c3b3d99bc23ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0.tar.gz:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dcd150a6d2a6ed4863c940dec13fe4f1e01c7cdf524ab17748b2ecd9fca912da
MD5 f19c278608c0abc8ec9663555fcab420
BLAKE2b-256 e8ad75c541ae809f8e2831026c3e705a895542074c72e0160196001739d896ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9f0adddf4f2273dfed08b1c6bb0a7c53bd92a0266fb35221921f7e71d85c36c0
MD5 9dc430d9ccd1f8c1aba07989b6b35270
BLAKE2b-256 cb6168b3f6a54d649d3948d909ff72c838a774f03c93f065326b15c1cb3af9df

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d6a0ef09db10331afd3062e9a61df61c01ff40fd2104facb41225e63295853c
MD5 49ee3e50f34343707272095bd02c6cf9
BLAKE2b-256 301429af792b87c31e929db30ef0c99644fcaf5e88e90edf163a2c5838e83dd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a645ca76faab14899ca4d734a28e8bc556b75b5b30e4e53bfb3a882c36f3a88b
MD5 b635c6fece51c58839b20bba38e84e80
BLAKE2b-256 1547c6c866873ad240eb8653e8283306a80c7b5260527d97f2825439fbe5b9d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2c5d9897559dd14b434de087c877a62ac69d1e9053abede44b752c65e7cec7c8
MD5 4fcb694c46ca22888f9927a02ad8a25e
BLAKE2b-256 e37a0a76b99012af57af2f200a6339393b703ef7e8baee33ebe23a5aa3b43d2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d567a49d3220a691e56283924d7479b57fe11f1a19d8c6e306007456bf2e365
MD5 8b2d0c322d24c5458293c2ac67716ea8
BLAKE2b-256 29f81fda6ade0bc8d2e24955cd6815d39dbf067eb7c02218f3577e405107a206

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 10350c457fbbb28ee49fc0f5a3f272b606e72166c79fce358fd57f875184cc6b
MD5 24695885b13b52b9daac31962a3db56d
BLAKE2b-256 362f2846c404fd333e510effaa1f842ee8e13c1658ed5cce44bcd6da14bdf25c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7c7d1572e1775b6a882725e0a7a8faee88adc80416f0eb01235c6a15fece340f
MD5 4c167bdecf86bc4538091899884625c4
BLAKE2b-256 3f963add76e8178bac2737f7cdfbcf221ddf62c4ef9730aacc499a302ceb6a33

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tessbind-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tessbind-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53131d520c7901803556ffbbe451449c588a0437ac8911c8a4ff1917598750f1
MD5 04f8df6885c261ff5df06b3ea2b864a8
BLAKE2b-256 24661267319b89bc1007ec6e3d67c379d7f8fdf6474193044a4542b12748c465

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-1.0.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: cd.yaml on elohmeier/tessbind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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