Skip to content

Local-first bank statement auditor for recurring charges and refund opportunities

Notifications You must be signed in to change notification settings

andreolf/refund-radar

Repository files navigation

refund-radar

A local-first, privacy-first bank statement auditor that detects recurring charges, flags suspicious transactions, and drafts ready-to-send refund requests.

Features

  • Recurring Charge Detection - Identifies subscriptions and regular payments with cadence estimation
  • Unexpected Charge Flagging - Spots duplicates, amount spikes, new merchants, and fee-like transactions
  • Refund Request Templates - Generates ready-to-send emails, chat messages, and formal disputes
  • Interactive HTML Reports - Beautiful local reports with privacy toggle and copy buttons
  • Zero Dependencies - Pure Python, no external libraries required
  • Privacy First - All processing happens locally, no network calls ever

Quick Start

# Clone the repo
git clone https://github.com/yourusername/refund-radar.git
cd refund-radar

# Install in development mode
pip install -e .

# Analyze a bank statement
python -m refund_radar analyze --csv examples/sample_bank.csv --month 2026-01

CLI Commands

Analyze a Statement

# From CSV file
python -m refund_radar analyze --csv ~/Downloads/statement.csv --month 2026-01

# From stdin (pasted text)
cat transactions.txt | python -m refund_radar analyze --stdin --month 2026-01 --default-currency CHF

Manage Merchants

# Mark a merchant as expected (wont flag in future)
python -m refund_radar mark-expected --merchant "AMZN Mktp"

# Mark a merchant as known recurring
python -m refund_radar mark-recurring --merchant "Spotify"

# List expected merchants
python -m refund_radar expected

Other Commands

# Reset all learned state
python -m refund_radar reset-state

# Export month data as JSON
python -m refund_radar export --month 2026-01 --out report.json

Supported Input Formats

CSV Files

The parser auto-detects:

  • Delimiter (comma, semicolon, tab)
  • Date column (date, booking date, posted date, etc.)
  • Description column (description, merchant, payee, etc.)
  • Amount formats (single column, debit/credit columns)
  • Date formats (YYYY-MM-DD, DD/MM/YYYY, MM/DD/YYYY)

Plain Text

2026-01-03 Spotify -11.99 CHF
03/01/2026 Uber 12.50 USD
2026-01-15 Salary +4500 USD

Output Files

Reports are saved to ~/.refund_radar/:

~/.refund_radar/
  state.json              # Learned preferences
  reports/
    2026-01.html          # Interactive HTML report
    2026-01.json          # Raw analysis data

Detection Rules

Recurring Charges

Detected when:

  • Same merchant appears 2+ times in 90 days
  • Amounts are similar (within 5% or $2)
  • Consistent cadence (weekly, monthly, yearly)
  • OR matches known subscription keywords (Netflix, Spotify, etc.)

Unexpected Charges

Type Trigger
New Merchant First time seeing merchant AND amount > $30
Amount Spike > 1.8x baseline AND delta > $25
Duplicate Same merchant + amount within 2 days
Fee-like Keywords (FEE, ATM, OVERDRAFT) AND amount > $3
Currency Anomaly Rare currency or DCC indicator

Example Output

$ python -m refund_radar analyze --csv statement.csv --month 2026-01

Parsed 47 transactions for 2026-01

==================================================
MONTH SUMMARY: 2026-01
==================================================
  Transactions: 47
  Total Spent:  $1,234.56
  Total Income: $4,500.00

RECURRING CHARGES (5)
  Netflix              $15.99/monthly   next: ~Feb 15
  Spotify              $11.99/monthly   next: ~Feb 03
  iCloud                $2.99/monthly   next: ~Feb 01
  ChatGPT Plus         $20.00/monthly   next: ~Feb 20
  Gym Membership       $49.00/monthly   next: ~Feb 10

FLAGGED (3)
  [ HIGH ] DUPLICATE: Amazon $29.99 on 2026-01-12
  [ HIGH ] AMOUNT SPIKE: Uber $87.50 on 2026-01-16
  [ LOW  ] FEE LIKE: ATM Withdrawal Fee $3.50 on 2026-01-14

Report saved: ~/.refund_radar/reports/2026-01.html

HTML Report Features

  • Privacy Toggle - Blur merchant names with one click
  • Dark/Light Mode - Persistent theme preference
  • Collapsible Sections - Focus on what matters
  • Copy Buttons - One-click copy for refund templates
  • Tone Variants - Switch between concise, firm, and friendly templates
  • Print Ready - Clean output for printing

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=refund_radar --cov-report=html

Privacy

  • No network calls. Everything runs locally.
  • No external APIs. No Plaid, no cloud services.
  • Your data stays on your machine. Reports are local HTML files.
  • Privacy toggle in reports. Blur merchant names with one click.

License

MIT

About

Local-first bank statement auditor for recurring charges and refund opportunities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published