How wilesses/receipt-intelligence works
Receipt Intelligence is a local Flask/SQLite application for turning grocery-receipt PDFs into reviewable spending data. Its main workflow imports a receipt, parses its items, normalizes product names, derives cautious price evidence, classifies purchases, and persists the result; users then explore analytics and product histories and resolve uncertain categories or product matches. The graph preserves the documented review, comparison, and data-quality capabilities. Some route details and UI wiring are unsampled, so those connections are shown only where excerpts, indexed references, or README statements support them.
Main entry points: routes.py Routes and workflows · db.py Receipt database · importer.py Receipt importer · price_deviation.py Price diagnostics
Components 21
Receipt ingestion
- Receipt importer
app/importer.py - Receipt parser
app/receipt_parser.py - Email fetcher
app/gmail_fetcher.py - Receipt database
app/db.py
Identity and quality
- Product normalizer
app/product_normalizer.py - Product matcher
app/product_matcher.py - Reporting identity
app/product_identity.py - Category rules
app/category_rules.py - Category taxonomy
app/category_keywords.py - Price evidence model
app/price_model.py - Price correction
app/price_correction.py
Analysis and review
- Price diagnostics
app/price_deviation.py - Diagnostic presentation
app/price_deviation_presentation.py - Analytics service
app/analytics_service.py - Dashboard service
app/dashboard_service.py - Store comparison
app/store_price_comparison.py
Application interface
- Flask interface
app/web/app.py - Routes and workflows
app/web/routes.py
Other components
- Receipt user
- Receipt PDFs
- Gmail
Connections 38
- Receipt user → Flask interface: uses
- Receipt PDFs → Receipt importer: imports
- Receipt user → Routes and workflows: submits receipts
- Flask interface → Routes and workflows: registers routes
app/web/app.py - Routes and workflows → Receipt importer: invokes import
app/web/routes.py - Receipt importer → Receipt parser: parses receipt
app/importer.py - Receipt importer → Receipt database: persists items
app/importer.py - Receipt importer → Product normalizer: normalizes names
app/importer.py - Receipt importer → Price evidence model: derives prices
app/importer.py - Receipt parser → Category taxonomy: categorizes items
app/receipt_parser.py - Receipt database → Product normalizer: normalizes names
app/db.py - Receipt database → Price evidence model: derives price data
app/db.py - Receipt database → Category rules: looks up rules
app/db.py - Category rules → Category taxonomy: normalizes categories
app/category_rules.py - Category rules → Product normalizer: builds product keys
app/category_rules.py - Routes and workflows → Email fetcher: checks email receipts
app/web/routes.py - Email fetcher → Gmail: fetches messages
- Routes and workflows → Receipt database: reads and updates
app/web/routes.py - Routes and workflows → Product matcher: finds suggestions
app/web/routes.py - Product matcher → Product normalizer: normalizes candidates
app/product_matcher.py - Product matcher → Reporting identity: uses identity
app/product_matcher.py - Routes and workflows → Price correction: handles correction
app/web/routes.py - Price correction → Price evidence model: uses price model
app/price_correction.py - Routes and workflows → Price diagnostics: evaluates prices
app/web/routes.py - Price diagnostics → Price evidence model: checks evidence
app/price_deviation.py - Price diagnostics → Reporting identity: groups observations
app/price_deviation.py - Routes and workflows → Diagnostic presentation: formats diagnostics
app/web/routes.py - Diagnostic presentation → Price diagnostics: presents results
app/price_deviation_presentation.py - Routes and workflows → Analytics service: requests analytics
app/web/routes.py - Analytics service → Receipt database: queries data
app/analytics_service.py - Analytics service → Price diagnostics: uses diagnostics
app/analytics_service.py - Analytics service → Reporting identity: uses identity
app/analytics_service.py - Routes and workflows → Dashboard service: requests dashboard
app/web/routes.py - Dashboard service → Receipt database: queries data
app/dashboard_service.py - Dashboard service → Product matcher: uses product matching
app/dashboard_service.py - Dashboard service → Reporting identity: uses identity
app/dashboard_service.py - Routes and workflows → Store comparison: requests comparison
app/web/routes.py - Store comparison → Price diagnostics: uses price evidence
app/store_price_comparison.py