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-0.16.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-0.16.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-0.16.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-0.16.0-cp314-cp314-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

tessbind-0.16.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-0.16.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-0.16.0-cp313-cp313-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tessbind-0.16.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-0.16.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-0.16.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-0.16.0.tar.gz.

File metadata

  • Download URL: tessbind-0.16.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-0.16.0.tar.gz
Algorithm Hash digest
SHA256 c65d037444056516d5a7de2eec358b53633a1c6a141a9b02128430ae6a8c47b2
MD5 6797a22acc09e6578b622103d426ddcd
BLAKE2b-256 62911ed7daf56759e7f015a7431ab958641dd96e1c8358c57eec7e29f7c9fdd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ba3d114d0490d755761e7c19b42aac4889d9e3dada271bfa3be47f56a2265a82
MD5 dc0f9cf355ef20a00e6820f180d05c55
BLAKE2b-256 2af8597d8bd9defb72340346298d0fc324878b104700ffc4f9001ddc5fa4d3e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d4a089bfed40875332b3ce20a44a5d11504dc00a7f8722e84f59737ec52f0fda
MD5 beac26a97c62fade35401f4e4554e34e
BLAKE2b-256 bd61b2a0b2db4fa938f907f432058d8fcdbd77827b4ff59a2f305d71a9a24905

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1ea2b111b93264232f5cc51337093f05bbf04afda6215fe82fc1fb8ecbb8225b
MD5 0a2a7b6f2737750cc9b249b71ea478f5
BLAKE2b-256 0b008fdb13d353a04fa09d0db59c8299c49d2704b48dcb42624c4d93b3efdbee

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6033ba2408fb5a7bb26b7e519003d611c0cc3a39988dda5384536d6f18e7c383
MD5 4544cb658928c6d99818ace9957456f2
BLAKE2b-256 d4ec383254500b83412073282095f6559996632b4e9c0bb7e85403472d5d5111

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 61538c94e457f782fb5789639486d2d2e719e6b235667f3d2d403d3cddc3c4ba
MD5 872312d129c2beffd104f97f37168abd
BLAKE2b-256 daeeda7f35f59c9de7645cf382232870ada4436af1b295e318b1ce58dbc875f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f88d94769b27b15008234b04281824e7d693d0bd1e8bd36a79846a951bf733fc
MD5 8b5a1da1228063c3048492b55294e477
BLAKE2b-256 d69cb550beef68661f53f996cc8ee0a34656f17e1ea05c776aaeef55b78d44af

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0aafbc6c85348f33e18703806e16f636bce14b147d9d17cc4e175d37065c6120
MD5 c192292a1ba23420f69f9a1cc8e7955b
BLAKE2b-256 02aaf9d293d7f5e196dadc13b504276103bb6d5778e73a61d2af5078d3287d4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0f8b2aa8be1141173660f61634f5bd2008e010272956d37b26548beb8008a2c6
MD5 71e872316fff5b134b81d3733ef0c6d8
BLAKE2b-256 2ce8a2873e100e0fc41fba7d8fed901530aa765c158611ec6096c8f5721643dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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-0.16.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tessbind-0.16.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 700332a0504d27f923b75e5be9e03cca3d6ef31f43951c31de7ce594288d3ba4
MD5 0e1a66d3d2a198753e00f1d3c22aa6f6
BLAKE2b-256 f84ad2e185510746004f476617d7172820ac59db4c45c0cc59bac4d992323234

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessbind-0.16.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