- Python 3.9+
- Poetry (dependency management)
- Tesseract OCR with language packs (for OCR functionality)
git clone https://github.com/fin-officer/invocr.git
cd invocr# Install Poetry if you don't have it
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry installsudo apt update
sudo apt install tesseract-ocr
# Install additional language packs as needed
sudo apt install tesseract-ocr-eng tesseract-ocr-pol tesseract-ocr-deu tesseract-ocr-frabrew install tesseract
# Install additional language packs
brew install tesseract-lang- Download and install Tesseract from UB Mannheim
- Add Tesseract to your PATH
- Download language data files from GitHub and place them in the Tesseract tessdata directory
# Check if Tesseract is installed correctly
tesseract --version
# Verify InvOCR installation
poetry run invocr --versionYou can customize InvOCR behavior by creating a configuration file:
# Create default configuration
poetry run invocr config init --output ./config/invocr.yaml
# Use custom configuration
poetry run invocr --config ./config/invocr.yaml convert invoice.pdf invoice.jsonFor development purposes, install with development dependencies:
poetry install --with devIf you encounter "Tesseract not found" errors:
- Verify Tesseract is installed:
tesseract --version - Check your PATH environment variable
- Set the environment variable:
export TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata/(adjust path as needed)
If you see "Warning: Invalid language" errors:
- Check available languages:
tesseract --list-langs - Install the required language pack for your OS
- For custom language packs, download from GitHub and place in the Tesseract tessdata directory