Built a script to categorize expenses automatically. Saved 3 hours/month.
Built a script to categorize expenses automatically. Saved 3 hours/month. Spent every Sunday sorting bank transactions into categories for my freelance accounting. Business meals, software subscriptions, travel, office supplies. Copying stuff from my bank CSV into a spreadsheet. After 6 months of this I finally snapped and wrote a Python script. Before (the painful way) Every week I'd download my bank CSV export. Then open it and categorize each transaction myself: Transaction at "Starbucks" → Business meal "AWS Invoice" → Software/tools "United Airlines" → Travel "Office Depot" → Office supplies For maybe 40 to 60 transactions per week this took about 45 minutes. Hated it. The script Basic Python that reads the bank CSV and categorizes based on keywords. Nothing fancy. import pandas as pd
Built a script to categorize expenses automatically. Saved 3 hours/month.
Spent every Sunday sorting bank transactions into categories for my freelance accounting. Business meals, software subscriptions, travel, office supplies. Copying stuff from my bank CSV into a spreadsheet. After 6 months of this I finally snapped and wrote a Python script.
Before (the painful way)
Every week I'd download my bank CSV export. Then open it and categorize each transaction myself:
-
Transaction at "Starbucks" → Business meal
-
"AWS Invoice" → Software/tools
-
"United Airlines" → Travel
-
"Office Depot" → Office supplies
For maybe 40 to 60 transactions per week this took about 45 minutes. Hated it.
The script
Basic Python that reads the bank CSV and categorizes based on keywords. Nothing fancy.
import pandas as pd
Category rules (keyword matching)
categories = { 'Software': ['aws', 'github', 'digitalocean', 'heroku', 'stripe'], 'Business Meals': ['starbucks', 'chipotle', 'subway', 'restaurant'], 'Travel': ['united', 'delta', 'airbnb', 'uber', 'lyft'], 'Office': ['staples', 'office depot', 'amazon'], }
def categorize_transaction(description): desc_lower = description.lower() for category, keywords in categories.items(): if any(keyword in desc_lower for keyword in keywords): return category return 'Other' # Default
Read bank CSV
df = pd.read_csv('bank_export.csv') df['Category'] = df['Description'].apply(categorize_transaction)
Save categorized output
df.to_csv('categorized_expenses.csv', index=False) print(f"Categorized {len(df)} transactions")`
Enter fullscreen mode
Exit fullscreen mode
How I use it now
-
Download CSV from bank (once a week)
-
Run script: python categorize.py
-
Get categorized CSV in 2 seconds
-
Import to Google Sheets for final review
Script handles about 85% of transactions automatically. The other 15% are random purchases I still do myself, but way better than doing everything.
What could be better
Super basic. No machine learning, no fancy NLP. Just keyword matching. Gets confused sometimes:
-
"Amazon" could be office supplies OR personal shopping
-
"Uber" to client meeting is business, Uber to gym is personal
Thought about adding ML but honestly the keyword approach works fine for my use case. If I spent more time training a model than I save, what's the point.
Time saved
Before: 45 min/week × 4 weeks = 3 hours/month
After: 10 min/week × 4 weeks = 40 min/month
Saved roughly 2h 20min/month. Worth the 2 hours I spent building it.
The keyword dict is easy to customize too. Just add your recurring vendors and categories. Put it on GitHub if anyone wants it.
DEV Community
https://dev.to/nicodev__/built-a-script-to-categorize-expenses-automatically-saved-3-hoursmonth-28mhSign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
modeltrainingreview![How to Embed ChatGPT in Your Website: 5 Methods Compared [2026 Guide]](https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fap1l58ek0p6aqj2yrzi6.png)
How to Embed ChatGPT in Your Website: 5 Methods Compared [2026 Guide]
You want ChatGPT on your website. Maybe for customer support. Maybe to answer FAQs automatically. Or maybe you're running live events and need AI to handle the flood of questions pouring into your chat room. Learning how to embed ChatGPT in your website is simpler than you think - but there's more to consider than most guides tell you. Here's the thing: most guides only cover half the picture. They show you how to add a basic AI chatbot widget. But what happens when 5,000 people hit your site during a product launch? What about moderating AI responses before your chatbot tells a customer something embarrassingly wrong? And what if you need AI assistance in a group chat, not just a 1-to-1 support conversation? To embed ChatGPT in your website, you have two main approaches: use a no-code pla

Why I Run 22 Docker Services at Home
Somewhere in my living room, a 2018 gaming PC is running 22 Docker containers, processing 15,000 emails through a local LLM, and managing the finances of a real business. It was never supposed to do any of this. I run a one-person software consultancy in the Netherlands; web development, 3D printing, and consulting. Last year, I started building an AI system to help me manage it all. Eight specialized agents handling email triage, financial tracking, infrastructure monitoring, and scheduling. Every piece of inference runs locally. No cloud APIs touching my private data. This post covers the hardware, what it actually costs, and what I'd do differently if I started over. The Setup: Three Machines, One Mesh Network The entire system runs on three machines connected via Tailscale mesh VPN: do
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.






Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!