Skip to content

GlitchG/receipt-sorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📂 Receipt Sorter

A local AI-powered receipt organiser for macOS. Drop receipts in — they get classified, renamed, and filed into the right folders automatically. Built for Portuguese freelancers (Trabalhador Independente) with smart IRS/IVA routing.

Python Flask Ollama macOS


What it does

  • Drop one or many receipts (PDF, JPG, PNG) → Ollama reads them locally
  • Classifies 23 document types: subscriptions, hardware, grocery, pharmacy, fuel, travel, utilities, rent, medical, and more
  • Smart deductibility detection: knows what's deductible for a PT freelancer under Recibos Verdes
  • Multi-folder filing: deductible invoices automatically copy to IRS_{year}/Deductible_Invoice/ and IVA_{year}/T{quarter}/ based on the invoice date
  • Renames files to a clean convention: vendor_description_DD_MM_YYYY.ext
  • Batch mode: queue 10+ files, review all, file everything in one click
  • Filing log: history of every document filed with destination and amount
  • Runs as a native macOS app — no browser, no terminal

Demo

Receipt-2675-8507-9281.pdf  →  anthropic_claude_pro_subscription_19_03_2026.pdf
                                ├── Finance/Portugal_Taxes/IVA/IVA_2026/T1/
                                ├── Finance/Portugal_Taxes/IRS/IRS_2026/Deductible_Invoice/
                                └── (primary move + 2 copies)

Requirements

  • macOS 12+
  • Python 3.11+
  • Ollama running locally with a vision model
ollama pull llava              # fast, recommended
# or
ollama pull llama3.2-vision   # higher accuracy

Setup

# 1. Clone
git clone https://github.com/GlitchG/receipt-sorter.git
cd receipt-sorter

# 2. Virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# 3. Configure folders
cp config.template.json config.json
# Edit config.json — replace YOUR_USERNAME with your actual paths
# Or launch the app and configure via ⚙ Settings

Run

As a native macOS app

Double-click Receipt Sorter.app in your Applications folder (after setup below).

From terminal

source venv/bin/activate
python main.py        # native window via pywebview
# or
python app.py         # browser at http://localhost:5055

Native .app setup (one-time)

# Copy the .app bundle to Applications
cp -r "Receipt Sorter.app" ~/Applications/

# Make the launcher executable
chmod +x ~/Applications/Receipt\ Sorter.app/Contents/MacOS/ReceiptSorter

Then open Finder → Applications → Receipt Sorter.

On first launch macOS may show a security warning. Go to System Settings → Privacy & Security and click "Open Anyway".


File naming convention

{vendor}_{description}_{DD_MM_YYYY}.{ext}

Examples:
  vodafone_pt_internet_bill_01_03_2026.pdf
  amazon_usb_hub_purchase_15_02_2026.pdf
  lidl_grocery_shop_10_03_2026.jpg
  clinica_medica_consultation_05_03_2026.pdf

Document types detected

Type Deductible (PT freelancer)
SaaS subscription
Software purchase
Hardware (work tools)
Internet / phone bill
Advertising spend
Professional service
Office supplies
Grocery / restaurant
Pharmacy
Fuel / transport partial
Travel
Rent / utilities
Medical
Insurance
Government fees

Stack

Component Role
Python + Flask Backend server
Ollama (llava / llama3.2-vision) Local AI — OCR + classification
pdfplumber Text extraction from PDFs
pywebview Native macOS window wrapper
Vanilla JS Frontend — no framework dependencies

Privacy

Everything runs 100% locally. No data leaves your machine. Ollama runs entirely offline.


Folder structure

receipt-sorter/
├── app.py                  # Flask backend
├── main.py                 # Native app entry point (pywebview)
├── config.json             # Your local paths (git-ignored)
├── config.template.json    # Template for setup
├── requirements.txt
├── templates/
│   └── index.html          # Frontend UI
└── Receipt Sorter.app/     # macOS app bundle

License

MIT

Related

About

Receipt Sorter for portuguese Trabalhador Independenre

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors