You are not logged in.

#1 2013-01-18 18:44:44

ibid
Member
From: Champaign, IL
Registered: 2009-10-20
Posts: 31
Website

Ideas for text based budget management and software

I'm looking for suggestions for text-based software or just basic scripts for tracking expenses.

For the last six months I've been recording my purchases in text files, one file for each month.
An entry looks like this:
01/01/2013,Schnucks,banana, groceries,1.00,cash

It works pretty well for recording info, no alternative system could be much faster than just adding a line to a text file.

Now that I've been recording data for about 6 months, I'm more interested in parsing through it to see what I'm spending in each month and in various categories. At the moment, I just run the files through grep and awk to get what I want. I'm contemplating writing a python program to let me filter and calculate totals and do whatever else comes to mind: importing credit card statements, generating graphs, etc. But at that point, I feel like I'm probably just re-inventing the wheel.

Does anybody want to share how they are handling a similar case?

I'm ok with changing my entry format, but I'm pretty attached to handling things as text files. I don't need anything more complex if it adds to the overhead of creating an entry.

Offline

#2 2013-01-18 19:40:11

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: Ideas for text based budget management and software

Hey, I been doing something very similar!
Except it also will measure income, so I can know how much I have done/expend this month, week, etc.

I don't have it at hand atm, but I use : to separate the fields, and use slashes to escape it (like \:)
Yes, that is a DSV file.
I haven't dedicated time to work on it lately, but I was writing a perl script to do the calculations.

One idea I have is to create an additonal file for a list of expenses names, like this:

milk-z:Milk brand Z:milk
milk-y:Milk brand Y:milk

the first field is an unique code for the product, second field a description, and third field is a category.
That way I could see how much I have expend on milk, no matter the brand.
On the expenses file, an expense would be similar to this:

2012-12-20:expense:milk-z:5.0

The first field has the date, in the format YYYY-MM-DD; that order is important to be able to sort the file if is necessary
Second field has "expense"; it could be "income" if it was an income
Third field is the product code - if its something I don't buy regulary, I could be only a name (like "new led tv" or something), if is an income, the reason behind the income.
And fourth field is just the amount of money.

Oh, I think I'll dedicate some time to the project again wink


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2013-01-18 19:50:04

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 135
Website

Re: Ideas for text based budget management and software

I don't use it but this was featured on a podcast a while back and I've always thought it looked interesting: https://github.com/ledger/ledger

It's in the AUR as well.


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#4 2013-01-18 19:54:30

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: Ideas for text based budget management and software

altercation wrote:

I don't use it but this was featured on a podcast a while back and I've always thought it looked interesting: https://github.com/ledger/ledger

It's in the AUR as well.

But it sure has lots of dependencies!


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#5 2013-01-18 19:58:33

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 135
Website

Re: Ideas for text based budget management and software

chris_l wrote:
altercation wrote:

I don't use it but this was featured on a podcast a while back and I've always thought it looked interesting: https://github.com/ledger/ledger

It's in the AUR as well.

But it sure has lots of dependencies!

https://aur.archlinux.org/packages.php?ID=3086

3 dependencies listed, all of which were already on my own system, at least. Seems pretty light to me. ymmv


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#6 2013-01-19 00:03:17

ibid
Member
From: Champaign, IL
Registered: 2009-10-20
Posts: 31
Website

Re: Ideas for text based budget management and software

altercation wrote:

I don't use it but this was featured on a podcast a while back and I've always thought it looked interesting: https://github.com/ledger/ledger

It's in the AUR as well.

Thanks for that. Installing now. It looks promising, I noticed there's a vim syntax file, so even better.

Offline

#7 2013-01-19 00:11:47

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: Ideas for text based budget management and software

altercation wrote:

3 dependencies listed, all of which were already on my own system, at least. Seems pretty light to me. ymmv

oh you are right, the rest are optional dependencies. Ok, I'm gonna try it.


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#8 2013-01-19 01:19:26

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 135
Website

Re: Ideas for text based budget management and software

Here's the podcast with the developer interview, worth listening to: http://twit.tv/floss150


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#9 2013-01-19 03:34:29

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,000
Website

Re: Ideas for text based budget management and software

Have you considered statistical software like GNU R?

You can easily import any/all of your csv files and get descriptive/summary data from them.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#10 2013-01-19 18:36:21

ibid
Member
From: Champaign, IL
Registered: 2009-10-20
Posts: 31
Website

Re: Ideas for text based budget management and software

Trilby wrote:

Have you considered statistical software like GNU R?

You can easily import any/all of your csv files and get descriptive/summary data from them.

R might be worth learning. One benefit of that is I won't have to convert my existing data to a new format. Converting my files to use ledger would take some thinking as it needs certain data like account names that I don't really have in my files.

Are there any examples of easily importing and summarizing data in R?

Offline

#11 2013-01-19 18:52:44

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,000
Website

Re: Ideas for text based budget management and software

While it's geared toward statistical analysis, you'd get all you'd need to get started from the pdf tutorial linked below which I recommend to anyone interested in getting started with R:

cran.r-project.org/doc/contrib/Verzani-SimpleR.pdf

There are also lots of other good resources and tutorials at cran.r-project.org - though I can't say it's the most well organized website.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#12 2013-01-19 20:03:10

ibid
Member
From: Champaign, IL
Registered: 2009-10-20
Posts: 31
Website

Re: Ideas for text based budget management and software

Trilby wrote:

While it's geared toward statistical analysis, you'd get all you'd need to get started from the pdf tutorial linked below which I recommend to anyone interested in getting started with R:

cran.r-project.org/doc/contrib/Verzani-SimpleR.pdf

There are also lots of other good resources and tutorials at cran.r-project.org - though I can't say it's the most well organized website.

Thanks for the link. R is not the most google-able topic.
This site looks good too: http://www.rseek.org/

A quick import of my file into R and glance at a few of the functions was promising. CSV import was painless and with the summary() command is immediately capable of counting occurrences of some term in a column, so i can see the number of cash, credit and check transactions. Hopefully with a little tweaking I can get those to be dollar totals instead of a count.

Other things to learn would be how to do some sort of query/filter on the data and make some useful graphs.

Offline

#13 2013-01-19 20:49:26

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,000
Website

Re: Ideas for text based budget management and software

Yes, R is not very googleable - I often include "GNU R <searchterm>" or "CRAN R <searchterm>".

but R has it's own built-in help/man pages for functions - in an interactive session you can type "? <searchterm>" and often get something useful.

R is quite good at querying from a table, though the syntax is a bit unique.  Consider the following example table:

date, vendor, category, product, price, payment-method
01/01/2013, Walmart, junk, widget, 5.00, cash
01/02/2013, Amazon.com, books, The Big R Book, 55.00, credit
01/02/2013, BigGroccery, grocceries, apples, 3.00, cash

Assuming that has been imported as a data.frame called "budget", you can - as you have, get the summary of the whole table with summary(budget).  But you can also get the total spent from `sum(budget$price)`, or more useful, you can get the total spent on grocceries with `sum(budget$price[budget$category == "grocceries"])` which selects the entries in price when the category is grocceries.

That is just one example, the tutorials will give many other examples.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

Board footer

Powered by FluxBB