Create a Monthly Expense Report with Cursor AI
Build a script that reads bank exports, categorizes expenses, and generates a polished monthly report.
Companion Video
What you’ll build
An automated expense report generator that takes a CSV bank export and produces a categorized monthly summary — ready to share or archive.
Prerequisites
- Cursor installed
- Python 3.10+
- A CSV export from your bank (date, description, amount columns)
Create the project structure
mkdir expense-report
cd expense-report
cursor .Ask Cursor to scaffold:
expense-report/
├── main.py
├── categorize.py
├── report.py
├── requirements.txt
└── data/
└── transactions.csvLoad and clean the CSV
In main.py, load your bank export with pandas:
import pandas as pd
df = pd.read_csv("data/transactions.csv")
df["amount"] = df["amount"].astype(float)
df["date"] = pd.to_datetime(df["date"])Categorize transactions
Create categorize.py with keyword-based rules:
CATEGORIES = {
"groceries": ["walmart", "costco", "whole foods"],
"dining": ["starbucks", "uber eats", "doordash"],
"utilities": ["hydro", "internet", "mobile"],
}Or ask Cursor to build smarter matching with fuzzy search.
Generate the report
In report.py, summarize by category:
summary = df.groupby("category")["amount"].sum().sort_values(ascending=False)
print(summary.to_string())Add totals, top merchants, and biggest single purchases.
Export to PDF or HTML
Ask Cursor:
Add a function that exports the monthly summary to a clean HTML report with a title, date range, and category breakdown table.
Open the HTML in your browser or print to PDF.
What you learned
- Loading and cleaning financial CSV data
- Rule-based categorization with AI assistance
- Generating readable reports from raw transactions
Next steps
- Schedule monthly runs with a cron job
- Email the report automatically
- Add charts with matplotlib or Plotly
Download PDF Guide
Get a printable PDF version of "Create a Monthly Expense Report with Cursor AI". Enter your email to download — we'll send you updates on new tutorials.
We respect your privacy. Unsubscribe anytime. See our privacy policy.