motivation
I wanted to start to record and analyze my consumer behaviour on a high level and have a practical way of overviewing my finances. My bank (postbank) has a nice but limited online banking interface. The big issue I have with it is that it only shows you transactions of the last 100 days. {INSERT RANT HERE}Fortunately this bank supports the Homebanking Computer Interface (HBCI) aka FinTS which allowed me to start fetching my bank transfers so I could build my own backlog without the 100 days limitation.
outstanding features
Recurring places where I shop are identified by their transaction purpose fields and tagged accordingly automatically after every download. I do this because purpose fields are mostly to verbose and stuffed with cryptic numbers and misleading information which cannot be filtered and previewed to me in the end. Own tags or labels make this much easier. High level tags are things like "food" or "entertainment" and lower level are the names of the shops or restaurants. Auto tags are managed through the txtags file which has one entry per line.food|some_string_that_is_matched_in_csv_line salary|company_account_number gym|fintess_center_company_nameManual tagging can be done with the cli for onetime purchases I want to record.
Filtering can be done with regex against every information on a transaction including own tags.
showcase
% tx ... 331 2016/12/03 -230.00 office desk ikea 332 2016/12/05 -50.00 electricity 333 2016/12/06 3261.80 company1 salary 334 2016/12/07 -23.89 shop1 food 335 2016/12/07 -6.14 shop2 food 336 2016/12/08 -6.90 movies entertainment 337 2016/12/12 -6.67 restaurant1 food 338 2016/12/13 -12.71 amazon +6874.07Invoking it without arguments will print all transactions with the sum of all values in the last line.
% tx "16/12.*food" ... 334 2016/12/07 -23.89 shop1 food 335 2016/12/07 -6.14 shop2 food 337 2016/12/12 -6.67 restaurant1 food -36.70Print all transactions done in december 2016 which are tagged with food.
All options implemented in this script.
p|pull) pull_tx;; b|balance) tail -n1 "$balfile" | cut -f2;; e|expenses) print_tx "^-" "$2";; r|revenue) print_tx "^[0-9]" $2;; t|tag) tag_tx "$@";; s|show) sed "$2q;d" "$txfile";; *) print_tx "^" "$1";;Now I can analyze which month I had the highest expanses.
for i in {01..12};do printf "$i/16 ";tx e | tail -n1;done