Ride Fare Calculator
Manually tallying ride fares across a folder of Uber receipts is nobody's favorite chore. This reads them, calculates the totals per currency, and outputs a formatted summary PDF plus a merged backup PDF, entirely inside Docker.
Overview
Filing an expense report from a folder of ride receipts is exactly the kind of tedious, error-prone task that shouldn’t need a human doing copy-paste. Drop a folder of Uber receipts in — PDFs, screenshots, mixed formats, doesn’t matter — and get back a submission-ready summary and a backup bundle, in one Docker run.
Highlights
- Reads anything you throw at it — proper PDF text extraction first, falling back to Tesseract OCR automatically for scanned receipts or screenshots, no manual sorting required beforehand.
- Actually parses the receipt, not just dumps text — pulls the date, booking time, fare and currency, pickup/dropoff addresses, and the rider’s name via targeted regexes, and strips the bilingual Arabic text the PDF font can’t render anyway (the English address is already complete on its own).
- Sorts and totals for you — every trip ordered chronologically, fares
summed per currency, with anything it couldn’t confidently parse flagged
as
NEEDS REVIEWin the console rather than silently mis-totaled. - Two clean outputs: a formatted summary PDF (table + totals + footer) and a second PDF merging every original receipt in the same sorted order as backup documentation — exactly what an expense system wants attached.
- Zero local setup — the whole OCR toolchain (Tesseract, Poppler)
lives inside the container;
docker compose run --rmand you’re done.
Stack
Python, pytesseract + pdf2image for OCR, reportlab for the summary
PDF, pypdf for merging, dependencies managed with uv, packaged as a
single one-off Docker Compose job (not a long-running service) on
python:3.11-slim.