Learning Scala, Analyzing Bank Statements (make #1)

Last year, I followed the Functional Programming course on Coursera by Martin Odersky. It was a thorough introduction to Scala. Right now I’m reading Pragmatic Scala by Venkat Subramaniam. So it was about time for some actual Scala code.

This is the first “make” I do this year. I’m joining Justin Jackson’s maker challenge. While Justin is planning out his challenge, I’m just going to see where it takes me. I think I can probably make about 12 things this year. The only promise I make, is that I’m going to write about them. Even if they are very basic in slightly embarrassing.

Expense Tracking

So back to the project at hand. As an entrepreneur, I’ve long been interested in figuring out how much I’m spending and how much of that is really essential. This will allow me to judge when one of my project is “ramen profitable”.

Over the years, I’ve tried quite a few ways to track my expenses. Mint didn’t really work for non-Americans and it has a lot of features I don’t need and that are just trying to sell me more stuff.

I tried to create a manual option. Make it as easy as possible to enter expenses. That worked up to a point, but having to enter every expense manually was ok for a month or two. After that it got tedious.

Automated Expense Tracking

So I’m back to trying to automate it. Seems like a great project for a new programming language.

Based on the bank statements that I can download from my online banking app (in CSV format), the program should categorize expenses.

Important are good and flexible matching rules.

The current version is not very flexible and certainly not perfect. But it already shows how powerful Scala is. With only a few lines of code, the result is already useful.

There are the two main features I still want to implement:

  • More powerful matching rules (based on Scala’s powerful pattern matching)
  • Incrementally import new bank statements

In any case, you can already check it out. Feel free to comment and extend.

Comments