Overview
Discover what makes Receipt Wrangler powerful
Receipt Wrangler is a self‑hosted backend for receipt management, built as an API service that powers the web and mobile frontends. From a developer’s perspective it is essentially a micro‑service that exposes RESTful endpoints for uploading, processing, and querying receipts. The core logic is split into three layers: an ingestion layer that accepts files or emails, a processing pipeline that runs OCR and AI models to extract structured data, and a persistence layer that stores receipts, users, groups, and split calculations in a relational database. The API is documented via OpenAPI/Swagger, making it easy to generate SDKs in any language.
Receipt Upload
OCR & Extraction
Email Hook
User & Group Management
Overview
Receipt Wrangler is a self‑hosted backend for receipt management, built as an API service that powers the web and mobile frontends. From a developer’s perspective it is essentially a micro‑service that exposes RESTful endpoints for uploading, processing, and querying receipts. The core logic is split into three layers: an ingestion layer that accepts files or emails, a processing pipeline that runs OCR and AI models to extract structured data, and a persistence layer that stores receipts, users, groups, and split calculations in a relational database. The API is documented via OpenAPI/Swagger, making it easy to generate SDKs in any language.
Architecture & Technical Stack
| Layer | Technology |
|---|---|
| API | FastAPI (Python 3.11) – chosen for its async support, type hints, and automatic docs |
| OCR & AI | Tesseract OCR integrated via pytesseract, coupled with a fine‑tuned HuggingFace transformer for entity extraction |
| Email Ingestion | IMAP/SMTP handlers written in aiosmtpd for asynchronous email parsing |
| Database | PostgreSQL 15, accessed through SQLAlchemy ORM; migrations managed by Alembic |
| Containerization | Docker image published to GitHub Container Registry; Docker‑Compose files provide a ready‑to‑run stack |
| Testing | PyTest + coverage (codecov badge) and CI via GitHub Actions |
| Licensing | AGPL‑3.0 – ensuring any derivative works remain open source |
The application follows a clean architecture approach: the domain models (Receipt, User, Group) are decoupled from framework concerns, allowing unit tests to run without a running database. The async nature of FastAPI and the use of asyncpg for PostgreSQL connection pooling gives the service high throughput, suitable for dozens of concurrent users.
Core Capabilities & APIs
- Receipt Upload –
POST /receipts/accepts multipart form data (image or PDF) and returns a receipt ID. - OCR & Extraction – Background task processes the file, stores raw OCR text and structured fields (date, total, items).
- Email Hook –
POST /email/webhook/can be configured on an IMAP server to automatically trigger receipt ingestion from incoming mail. - User & Group Management – CRUD endpoints for users, roles, and group membership; JWT‑based authentication.
- Splitting Logic –
POST /groups/{id}/splitcalculates equitable shares, generates receipts, and returns a share manifest. - Webhooks – Developers can subscribe to events (receipt created, split finalized) via
POST /webhook/subscriptions. - Health & Metrics –
/health,/metricsexpose readiness and Prometheus metrics for observability.
All endpoints return JSON, and the API adheres to HATEOAS principles where applicable, making it straightforward for client libraries to navigate resources.
Deployment & Infrastructure
Receipt Wrangler is designed to run in a Docker container, but can also be deployed on any platform that supports Python 3.11 and PostgreSQL. The docker-compose.yml file bundles:
- api – the FastAPI service
- db – PostgreSQL container with volume persistence
- maildev – optional local SMTP server for testing email ingestion
For production, the recommended stack includes:
- Kubernetes – Helm chart (not yet available) could be built from the existing Dockerfiles.
- CI/CD – GitHub Actions build image, run tests, push to GHCR; automated rollback on test failures.
- Scaling – The API is stateless, so horizontal scaling is trivial; a shared Redis cache can be added for rate limiting or background job queues if needed.
Integration & Extensibility
The project exposes a well‑defined OpenAPI spec, enabling developers to generate SDKs for JavaScript, Go, or any language that supports Swagger. Customization is possible via:
- Plugin Hooks – The ingestion pipeline accepts custom processors; implement a new class that inherits from
BaseProcessorand register it in the config. - Webhook Endpoints – External services can listen to receipt events and trigger workflows (e.g., ledger posting, accounting integration).
- Database Migration – Alembic scripts can be extended to add new tables or fields without breaking existing deployments.
- Configuration – YAML/JSON config files control OCR thresholds, email server settings, and feature toggles; environment variables override defaults for CI/CD pipelines.
Developer Experience
The codebase follows PEP‑8 conventions, and the documentation is split into a public website (receiptwrangler.io) and an internal developer portal. The API docs are auto‑generated, with example requests and responses. Community support is active on GitHub Discussions, where contributors discuss feature requests and bug reports. The AGPL license ensures that any modifications remain open source, fostering a collaborative ecosystem.
Use Cases
- Small Business Expense Tracking – A developer can deploy the stack behind a corporate VPN, integrate with an internal email server, and expose a custom front‑end for employees to upload receipts.
- Event Budgeting App – Using the group and split APIs, a developer can build an event planning tool that automatically splits shared costs among attendees.
- Personal Finance Tool – For hobbyists, a single‑node Docker deployment on a Raspberry Pi can serve as a personal receipt vault with AI extraction.
- Accounting Integration – By subscribing to webhooks, a developer can push extracted data into QuickBooks or X
Open SourceReady to get started?
Join the community and start self-hosting Receipt Wrangler today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Flyimg
On‑Demand Image Resizing and Compression Service
Lidify
Music discovery powered by your Lidarr library
Ever Gauzy
All-in-one business management platform for the sharing economy
Live Helper Chat
Free, enterprise‑grade live support for websites
Webtor
Instant torrent streaming and direct downloads in one app
linkding
Self‑hosted bookmark manager for minimal, fast organization