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

Uploaded CPython 3.14macOS 11.0+ ARM64

tessbind-1.1.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.1.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.1.0-cp313-cp313-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tessbind-1.1.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.1.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.1.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.1.0.tar.gz.

File metadata

  • Download URL: tessbind-1.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 7694ae2295230d56f47ff0850cb0953a31b1cf7b134c121c030e157fe35d2783
MD5 eec7acb7ea8a8150843a50abc4b6cca7
BLAKE2b-256 46e069fe1bc6ec0b23bf9e08eec34383ad8513f4fef46f11d1d069e4b1b81c84

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e278692950b02ea2593580cd9659b20d028be3e2913795d6fa8ea4c67289e1f3
MD5 9d464ecc57656251094bd37d2828af84
BLAKE2b-256 04e9d9948526ae2de03006b4b058e70a848c9e0563a55238aa261bb039dacc44

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c4fbe21e1355e20bbac3a509a3ec582b027e82e88746ec57481900453a2d9d0a
MD5 1893802efa2c0a668c78bd5688a366e8
BLAKE2b-256 ad6b5c8ed16932ba23afa03e873b1b8b127edd08b67675201db30d68075b12f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1c732bf66e76e59d6e2561cc5f3397e0ee355e1cb00399566a34f655b160d4a
MD5 8192a5ef9df8a2b05ffb0f28c4769b6b
BLAKE2b-256 4ba8052c4bcdc51e964f5ca1332d95733ef8836d1477f0eff01aa945f26c667d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 53dfc02e6dd8d016191f88f1cc15517b587a9e9007af6588ec706fff20f1dacd
MD5 3580e9ffee1146ade1133f0e3812e70c
BLAKE2b-256 60bf441ba17df55c237ac5ba75cbbbe58d6900e80d1fc73ba9d368cc92916995

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9c39ac9dc8934b88d2765b5b327cf5ada4e4f251c5d372b2afad18ed4a136c6c
MD5 b98b36b56c5e64a87dc420553233e062
BLAKE2b-256 26322bc25f96547be93997f83ea4256bf92d9c62716c8af6df6235aa856e69c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b41a1b24798bad81cd71bd9635d75828a16faf1b65f9c4747149496d8776d465
MD5 5dd1d062d8c8e74b67ce0d96809ee90d
BLAKE2b-256 ae14c7d56c8ba5045fdb2d313ea1e85a80b6de23f73946beef84d9618a1d9940

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bbce8ea190725c7e4cc93d59d0b99cebca30c7b5ed5ff60557f005503ffcc123
MD5 8aa1b6ebd7d04bf762840593169df204
BLAKE2b-256 3c4a51d2366988fc4920bb5fea088511c4e3e85e2ebf6a4d5cab1bcf3935732b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6771db5ba1ec54e1174544c0c762b8862de643e136ad8466a3b2a8672d186220
MD5 d512425f451171cca0e88c9e0d7fdb62
BLAKE2b-256 a1db913884c84e0012dcf73ce0ccf90189a4ced02b1764e66cd719515c11f896

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tessbind-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5a3cac5c86690faa6c5241bed599d97398a3ced6b25f32a2b3065a26360079d
MD5 7e16c11a2026f63c57dcddd3d6088a91
BLAKE2b-256 9f2f8d75461ff3e6524a0d06fa27f3021f27e2c4a9657f984422fead9de0bfc3

See more details on using hashes here.

Provenance

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