Core interfaces and utilities for OCR Bridge engine packages
Project description
OCR Bridge Core
Core interfaces and utilities for OCR Bridge engine packages.
Overview
ocrbridge-core provides the foundational abstract base classes, models, and utilities that all OCR engine packages must implement. This package enables a modular, plugin-based architecture where OCR engines can be dynamically discovered and loaded at runtime.
Installation
pip install ocrbridge-core
For local development, we recommend using uv and the provided Makefile.
See CONTRIBUTING.md for detailed setup instructions.
# Quick start (requires uv)
make install
make check
Core Components
OCREngine Base Class
All OCR engines must inherit from OCREngine and implement:
process(file_path, params)- Process a document and return HOCR XMLnameproperty - Engine identifier (e.g., 'tesseract', 'easyocr')supported_formatsproperty - Set of supported file extensions
OCREngineParams
Base model for engine-specific parameters using Pydantic validation.
Exceptions
OCRBridgeError- Base exceptionOCRProcessingError- Processing failuresUnsupportedFormatError- Unsupported file formatEngineNotAvailableError- Engine not installed/availableInvalidParametersError- Invalid parameters
HOCR Utilities
Helper functions for HOCR XML parsing, validation, and conversion:
parse_hocr()- Parse and extract HOCR informationvalidate_hocr()- Validate HOCR structureextract_bbox()- Extract bounding box coordinateseasyocr_to_hocr()- Convert EasyOCR results to HOCR format
Implementing a New Engine
See the engine packages for examples:
ocrbridge-tesseract- Simple reference implementationocrbridge-easyocr- Deep learning with GPU supportocrbridge-ocrmac- Platform-specific (macOS only)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ocrbridge_core-3.1.1.tar.gz.
File metadata
- Download URL: ocrbridge_core-3.1.1.tar.gz
- Upload date:
- Size: 104.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd7601b38314b6d6d686d6f779764a0931e9e9279c311a2ee6a758eca876d572
|
|
| MD5 |
05f86df33f5ebf1d9a4f9510ed75b7f7
|
|
| BLAKE2b-256 |
b3d1405e30f8a41dc1c4b998c3a2f6fd5d5630d7c60933f049a00ad42d538448
|
Provenance
The following attestation bundles were made for ocrbridge_core-3.1.1.tar.gz:
Publisher:
release.yml on OCRBridge/ocrbridge-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocrbridge_core-3.1.1.tar.gz -
Subject digest:
bd7601b38314b6d6d686d6f779764a0931e9e9279c311a2ee6a758eca876d572 - Sigstore transparency entry: 784812438
- Sigstore integration time:
-
Permalink:
OCRBridge/ocrbridge-core@3c7e7c9d7f62e9444b73fb3d5a5066cdfda5ae69 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OCRBridge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3c7e7c9d7f62e9444b73fb3d5a5066cdfda5ae69 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ocrbridge_core-3.1.1-py3-none-any.whl.
File metadata
- Download URL: ocrbridge_core-3.1.1-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5ba285c922cbd812f33cc13934ff2414df4d039556cf2426a7748ddb58cf7e6
|
|
| MD5 |
a8425ddcf501b2da54dea31f626a383c
|
|
| BLAKE2b-256 |
df6860181dfbbac734dbd8221a7eb17f868ac2c171423f3ff31e50c2065a6915
|
Provenance
The following attestation bundles were made for ocrbridge_core-3.1.1-py3-none-any.whl:
Publisher:
release.yml on OCRBridge/ocrbridge-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocrbridge_core-3.1.1-py3-none-any.whl -
Subject digest:
f5ba285c922cbd812f33cc13934ff2414df4d039556cf2426a7748ddb58cf7e6 - Sigstore transparency entry: 784812476
- Sigstore integration time:
-
Permalink:
OCRBridge/ocrbridge-core@3c7e7c9d7f62e9444b73fb3d5a5066cdfda5ae69 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OCRBridge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3c7e7c9d7f62e9444b73fb3d5a5066cdfda5ae69 -
Trigger Event:
push
-
Statement type: