Installation
Install payable-receipt-ocr and its Tesseract dependencies.
Requirements
- Python 3.10 or newer
- Tesseract OCR executable on your
PATH eng.traineddataandDevanagari.traineddatamodel files (see Tesseract setup)
The package does not download models at runtime. Models must be installed before any recognition
call is made. Recognition fails closed with RuntimeBaselineError if either model is missing or
its checksum does not match the pinned value.
Install Tesseract
macOS (supported development environment; conformance target is Ubuntu 24.04 / amd64):
brew install tesseractUbuntu / Debian:
sudo apt-get update
sudo apt-get install tesseract-ocrInstall the Python package
Install directly from the GitHub repository:
pip install git+https://github.com/FireBird1998/payable-receipt-ocr.gitInstall the Tesseract models
After cloning the repository, run the setup script once. It downloads eng.traineddata and
Devanagari.traineddata from the
tessdata_fast project (Apache 2.0), verifies
their SHA-256 checksums, and stores them under the user data directory where the package finds
them automatically:
git clone https://github.com/FireBird1998/payable-receipt-ocr.git
cd payable-receipt-ocr
./scripts/setup-models.shVerify the installation
from payable_receipt_ocr import recognize
print("payable-receipt-ocr ready")If Tesseract is not on PATH or the models are not installed, this import succeeds but the first
recognize() call will raise RuntimeBaselineError. See
Tesseract setup for troubleshooting.
Development install
To work on the library itself:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install --editable '.[dev]'
./scripts/setup-models.sh