← all repositories
bhimrazy/receipt-ocr

Receipt OCR that makes Tesseract and LLMs share the bill

It wraps Tesseract and OpenAI-compatible LLMs into a single toolkit for turning receipt images into raw text or structured JSON.

697 stars Python Computer VisionData Tooling
receipt-ocr
Collecting fresh signals — velocity needs a few days of history.
star history

What it does

receipt-ocr is a Python toolkit that processes receipt images through two distinct paths. One module runs Tesseract OCR to extract raw, unstructured text from images locally. The other module sends images to an OpenAI-compatible LLM—supporting OpenAI, Gemini, or Groq—and returns parsed JSON containing merchant details, line items, totals, and timestamps. Both modules include a FastAPI web service, a CLI, and a programmatic API.

The interesting bit

Rather than picking a winner in the OCR-versus-LLM debate, the project treats them as a tag team: Tesseract handles the offline grunt work, and the LLM handles the brittle logic of turning text into structured fields. It even reuses the OPENAI_API_KEY environment variable for Gemini and Groq credentials, which is either pragmatic resourcefulness or mild chaos, depending on your tolerance for abstraction leaks.

Key highlights

  • Dual-mode architecture: Tesseract for raw text, LLMs for structured JSON extraction.
  • Supports multiple LLM providers—OpenAI, Gemini, and Groq—through a single OpenAI-compatible client.
  • Ships with FastAPI services, a CLI, and a Python API for both the Tesseract and LLM modules.
  • Structured output includes merchant name, address, transaction date and time, total amount, and individual line items.
  • The Tesseract path runs fully offline; the LLM path requires an API key and network access.

Caveats

  • The LLM module reuses the OPENAI_API_KEY environment variable for Gemini and Groq, which is documented but potentially confusing.
  • Tesseract output is raw text only; structured parsing is strictly gated behind an LLM API call.
  • The README explicitly warns that Tesseract accuracy depends on well-lit images with clearly visible, non-skewed edges.

Verdict

Worth a look if you want a quick, drop-in receipt parser with both a free offline tier and a premium structured-extraction tier, or if you need a FastAPI wrapper around Tesseract and OpenAI-style APIs. Skip it if you require a fully offline structured solution or if leaky environment-variable abstractions make you nervous.

Frequently asked

What is bhimrazy/receipt-ocr?
It wraps Tesseract and OpenAI-compatible LLMs into a single toolkit for turning receipt images into raw text or structured JSON.
Is receipt-ocr open source?
Yes — bhimrazy/receipt-ocr is open source, released under the MIT license.
What language is receipt-ocr written in?
bhimrazy/receipt-ocr is primarily written in Python.
How popular is receipt-ocr?
bhimrazy/receipt-ocr has 697 stars on GitHub.
Where can I find receipt-ocr?
bhimrazy/receipt-ocr is on GitHub at https://github.com/bhimrazy/receipt-ocr.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.