StackMap
Subscribe
Explore / receipt-ocr
bhimrazy

receipt-ocr

Receipt-to-JSON in one pip install: CLI, Python API and FastAPI service that send a receipt image to any OpenAI-compatible model and return merchant, totals and line items, plus a Tesseract module.

636 79 Python MITupdated 28 days ago
View on GitHubDispute this mapping →
Curator's take

Narrow on purpose, and that is the value — one schema, one document type, a working CLI, Docker service and FastAPI app on day one, and any OpenAI-compatible endpoint (OpenAI, Gemini, Groq) behind a single env var. Do not mistake it for a document-intelligence stack: no layout model, no bounding boxes, no batch pipeline, and accuracy is entirely whatever VLM you point it at. Good as a reference implementation or the expenses corner of a larger app; wrong choice for mixed document types or on-prem throughput.

Mapped by ShipWithAI editors · links verified
README.md

Receipt OCR Engine

Build Status Code Coverage License

An efficient OCR engine for receipt image processing.

This repository provides a comprehensive solution for Optical Character Recognition (OCR) on receipt images, featuring both a dedicated Tesseract OCR module and a general receipt processing package using LLMs.

image

Star History

Star History Chart

Table of Contents

Quick Start

Extract structured data from a receipt in 3 steps:

  1. Install the package:

    pip install receipt-ocr
    
  2. Set up your API key:

    export OPENAI_API_KEY="your_openai_api_key_here"
    
  3. Process a receipt:

    receipt-ocr images/receipt.jpg
    

For Docker or advanced usage, see How to Use Receipt OCR below.

Project Structure

The project is organized into two main modules:

  • src/receipt_ocr/: A new package for abstracting general receipt processing logic, including CLI, programmatic API, and a production FastAPI web service for LLM-powered structured data extraction from receipts.
  • src/tesseract_ocr/: Contains the Tesseract OCR FastAPI application, CLI, utility functions, and Docker setup for performing raw OCR text extraction from images.

Prerequisites

  • Python 3.x
  • Docker & Docker-compose(for running as a service)
  • Tesseract OCR (for local Tesseract CLI usage) - Installation Guide

How to Use Receipt OCR

Receipt OCR Module (Structured Data Extraction)

This module provides a higher-level abstraction for processing receipts, leveraging LLMs for parsing and extraction.

To use the receipt-ocr CLI, first install it:

pip install receipt-ocr
  1. Configure Environment Variables: Create a .env file in the project root or set environment variables directly. This module supports multiple LLM providers.

    Supported Providers:

Continue your stack

What teams reach for next — and why each earns a place beside receipt-ocr. Ranked by curator confidence.