Skip to main content

Tesseract pybind11 bindings

Project description

tessbind

CI CD

PyPI version PyPI platforms License

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

Uploaded CPython 3.14macOS 11.0+ ARM64

tessbind-1.2.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.2.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.2.0-cp313-cp313-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tessbind-1.2.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.2.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.2.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.2.0.tar.gz.

File metadata

  • Download URL: tessbind-1.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 a8b099cae491b1656b0d969ed02809113d36027cb5da3309ed991b4d743c1a83
MD5 86f7753f6964b205e547c7e8fa54cfab
BLAKE2b-256 c70afec3b200fe4cbc27ebdef7292ab80a27ad1b7ffe3c82fe0e90f670a1d72c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce58050031cfeea5257b625de91e8fe0a13dc3ddfeb393270b5fab947e77ec22
MD5 813cf129660d1fe0c08169b53d4ac72b
BLAKE2b-256 b22b33c5230017d4877266952b80153f928442971702b2fcc7c249bc73022889

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 26f8178dbba63e76c21f647d7ca4ea95c1185e28bc1711c0550ac6e8ecde6974
MD5 8533635d6c77c59944b8297c7f9aaa16
BLAKE2b-256 11dfa1d842f0ae75b423b03d3eecf32ecd12a52062b2f6e8910581bfba4876a8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c8ed969abb19e521ddb24309dce0467d8f169789b4e690cb9117ed9b97f28ed
MD5 f095471c21115214806c72340881f133
BLAKE2b-256 fd327a585413401fb6c37ed643d996b90b2e01f5d2a103bfc07bf8a96e886486

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 52c8a2337ca2474f6e6b7bbb84f72b02147adcbee05ace07e1e3546e12e9950b
MD5 77aefd8f7eef1ec2f401b18ea28f9e26
BLAKE2b-256 ed7036527717a8d8c9b559d5889f38e3632446f00af80f996b0c6b412b2c895d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 403f4abea77f7360ffa092041d6f76436c0c6cd46532c0663a78007e100df1b2
MD5 637ec71bd421ea391d6078ed2b5267f1
BLAKE2b-256 ad0b29fafa376ffc8e2e284fc8dcadd6dadb3c09f1f4e1b074b2f57f77485468

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c49af115d2ffc3c4500c17096ac6d8dfda6c9d82661b347bd62bc3624f3a3b1
MD5 00c109a4246e56c3d9c5d7e78ac3e8fd
BLAKE2b-256 7d7bb3250aa08c3d026844d8a423d982c9885eb73121b3b8cab5792fa9e4bb41

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9cb3a9206125898b4a24a0b4b6c1338f9d34e6ef399914500d37749b3889dd68
MD5 7b21baeb1ce386a6ecff644df6250a21
BLAKE2b-256 da897e888835e9593d0b1b00730b7409e944d5d53a6b87e1332cca4e207f3d3a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e8d5c90a4cb91a4f0de7ab37cd7ef117df512cb7704ba9e7f2e3e7a88511acfd
MD5 b16e373042979c3c03e62a0b66e74bb2
BLAKE2b-256 5c3408cac7f148c93c023a82d7f69447aff70cd730617e4bd6be3c55fdbcb0de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ade5e582ee7ab54eb70934d0d55f8b68f7063601a90f35e73bcc3b5777b65a5b
MD5 97388911a8e8b7502dd3ba79574bbd9c
BLAKE2b-256 5e3d81339840c99eb5791c637f991f0305d31d39d585fa5ffa015a08e1f12911

See more details on using hashes here.

Provenance

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