Python/Flask backend with pdfplumber parser, Svelte 4 frontend, Docker multi-stage build. Includes category analysis, insights, monthly/weekly charts, subscription audit, and annualised projections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.1 KiB
Plan What we're building A Python-based tool with two main capabilities:
Statement Analysis — Upload AMEX PDF statements, parse transactions, and produce spending insights (categories, trends, totals, etc.) Automated Statement Retrieval — A web interface that can log into your AMEX account and download statements automatically.
Architecture Component 1: PDF Statement Parser & Analyser
Python script using pdfplumber or tabula-py to extract transaction data from AMEX PDF statements Parse out: date, description, amount, and (optionally) category Produce summary stats: total spend, category breakdown, merchant frequency, monthly trends Output as structured data (CSV/JSON) + summary report
Component 2: Web App with AMEX Login Automation
A lightweight Flask or FastAPI web app File upload endpoint for manual PDF analysis Automated login to AMEX using Playwright (headless browser) — this handles the JS-heavy AMEX site, MFA challenges, etc. Statement download triggered from the web UI
Component 3: Dashboard / Reporting
Either a simple HTML dashboard (React artifact) or generated charts Spending by category, merchant, time period
Key Considerations
AMEX login automation is fragile — AMEX actively blocks bots, requires MFA, and changes their UI. Playwright is the most resilient approach but you'll likely need to handle MFA interactively (e.g. pause for SMS/email code entry). PDF parsing varies by statement format — NZ AMEX statements may differ from US ones. We'll need a sample to tune the parser. Security — credentials should never be stored in code; we'll use environment variables or a .env file.
Proof of Concept Scope For the POC, I'll build:
amex_parser.py — PDF statement parser that extracts transactions into structured data amex_analyser.py — Analysis module (totals, categories, trends) app.py — Flask web app with upload UI + results display amex_scraper.py — Playwright-based AMEX login & statement downloader (interactive MFA) Frontend — Clean upload + dashboard UI
Tech Stack
Python 3.11+ pdfplumber for PDF parsing Flask for web app Playwright for browser automation pandas for data analysis plotly or chart.js for visualisation