I’ve been trying to get a grip over my finances - and the best way of doing this is to have a budget - and stick to it. The problem with budgets is that I’m a little optimistic with my budget and manage to underestimate how much I spend.
I divide my budget into different categories; Food, car, petrol, geekiness, etc. To get an idea of how much I spend in each category I tend to look through my bank statements. With paper statements I found out that however good my intentions were the envelopes were never opened and they soon stacked up on my desk. Deciding to save paper, and the environment I recently switched to digital statements - but found that I was even less inclined to spend time looking at what I’d spent my money on.
Excluding it being a very depressing exercise I concluded that this was down to several reasons: - Arriving at the end of the month the bank statements were always out of date - A running total balance wasn’t useful - what I wanted was a total of what I had spent on my different categories
Taking this into account I devised an application which would increase the relevance of my bank statements - unfortunately it didn’t make the statements any more cheerful, or easier to read.
I bank with HSBC - and their web site allows you to download your transactions. For credit cards this is available as a PDF document, and for bank accounts you can download as QIF or CSV. Once imported into my application (named BetterBankStatement) I was able then to categorize each transaction based on it’s associating text.
For example the following transaction originating from the self service kiosk at Reading station would fall into my “Train” budget category.
FGW SELF SERVICE READING GBR
BetterBankStatement has a file called filters.yaml which contains a list of regular expressions. When a transaction text matches one of the regular expressions it categorizes the transaction. So for the above example I wrote the following:
- :category: Train :expression: !ruby/regexp /(FGW SELF SERVICE|RAILWAYS|FIRST GREAT WEST)/
This regular expression allowed me to match most transactions which would fall into my “Train” category. Once I had a list of transactions associated with a category I could create more meaningful bank statements. I could then group transactions and categories by date range and output this as HTML.
You can have a look at an example statement here: http://www.owengriffin.com/betterbankstatement/example/20091123_20091223.html
You can obtain this application by cloning my Git repository:
git clone git://github.com/owengriffin/betterbankstatement.git
You will find instructions for installing and running BetterBankStatement on Ubuntu in the README.markdown file.