Time tracking - is this possible?

368 views
Skip to first unread message

Eugene Kuzmitsky

unread,
Sep 18, 2016, 11:18:29 PM9/18/16
to Beancount
Hi!

Being a Beancount user for a while, I'm just curious, is there any method of tracking hours in Beancount? I mean ledger-like feature, not just VACHR (from example) without fractional part of hours. It would be great to have this, so one can plot the time spent by category, say, in fava.

Thank you in advance,
Eugene

redst...@gmail.com

unread,
Sep 25, 2016, 10:13:30 PM9/25/16
to Beancount
Beancount lets you define any currency you want on the fly. You can plot any of these in fava. Can you be specific on why the VACHR example does not work for you?

Eugene Kuzmitsky

unread,
Sep 25, 2016, 10:24:08 PM9/25/16
to Beancount, redst...@gmail.com
Sure,

With VACHR approach, I believe, I can't record time intervals like 1h 25 min etc. In ledger-cli we can use such a format, I guess, but not here.

Martin Blais

unread,
Sep 25, 2016, 10:27:50 PM9/25/16
to Beancount, Red S
Ah I see. You want "hours minutes" type of format, with minutes over 60 minutes to form an hour. 

I suppose we could define a number of regex "[0-9]{1,2}+h[0-9]{2}" to translate to the equivalent number of minutes or hours, generically. It's ugly - very specific, and could be used entirely out of context to do weird things - but it would work.

I doubt I'll add that for a while, that would be quite a special case.



--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/c5bcead4-5827-4920-8685-db70fbd93e7f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

redst...@gmail.com

unread,
Sep 25, 2016, 11:39:31 PM9/25/16
to Beancount, redst...@gmail.com
Until then, if you really want it, a bit of a hacky way is to write a simple plugin to rewrite to scale the numbers on all specified currencies (eg: VACHR, or anything ending with an HR).

Eg: 7.30 VACHR would be rewritten to 7.50 VACHR

1.30 refers to 7 hours, 30 minutes, which is 7.50 hours.


On Sunday, September 25, 2016 at 7:27:50 PM UTC-7, Martin Blais wrote:
Ah I see. You want "hours minutes" type of format, with minutes over 60 minutes to form an hour. 

I suppose we could define a number of regex "[0-9]{1,2}+h[0-9]{2}" to translate to the equivalent number of minutes or hours, generically. It's ugly - very specific, and could be used entirely out of context to do weird things - but it would work.

I doubt I'll add that for a while, that would be quite a special case.


On Sun, Sep 25, 2016 at 10:24 PM, Eugene Kuzmitsky <tubo...@gmail.com> wrote:
Sure,

With VACHR approach, I believe, I can't record time intervals like 1h 25 min etc. In ledger-cli we can use such a format, I guess, but not here.

On Sunday, 25 September 2016 22:13:30 UTC-4, redst...@gmail.com wrote:
Beancount lets you define any currency you want on the fly. You can plot any of these in fava. Can you be specific on why the VACHR example does not work for you?

On Sunday, September 18, 2016 at 8:18:29 PM UTC-7, Eugene Kuzmitsky wrote:
Hi!

Being a Beancount user for a while, I'm just curious, is there any method of tracking hours in Beancount? I mean ledger-like feature, not just VACHR (from example) without fractional part of hours. It would be great to have this, so one can plot the time spent by category, say, in fava.

Thank you in advance,
Eugene

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Martin Blais

unread,
Sep 26, 2016, 12:11:44 AM9/26/16
to Beancount
Clever.

Might even work. Only problem is if there is math before the plugins run, e.g. on interpolation, things might get weird real quick. A safer way to hack this in would be to preprocess the input file through a text transformation.



To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

yegle

unread,
Sep 26, 2016, 12:25:12 AM9/26/16
to Beancount

I guess tracking VACMINUTE would also work, if you have a fixed price between VACMINUTE and VACHR.


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.

Eugene Kuzmitsky

unread,
Sep 28, 2016, 8:05:18 PM9/28/16
to Beancount
Thank you, all, for your comments.

Actually, track only minutes seems to me a bit non-practical. Plugin approach could really create a mess. So may be the best way to track the time is to go with some different dedicated time tracking tools.

mpl...@gmail.com

unread,
Feb 18, 2019, 5:37:55 AM2/18/19
to Beancount
Martin, did you ever end up implementing it?

I would be also interested to have possibility to track time.

On Sunday, September 25, 2016 at 10:27:50 PM UTC-4, Martin Blais wrote:
Ah I see. You want "hours minutes" type of format, with minutes over 60 minutes to form an hour. 

I suppose we could define a number of regex "[0-9]{1,2}+h[0-9]{2}" to translate to the equivalent number of minutes or hours, generically. It's ugly - very specific, and could be used entirely out of context to do weird things - but it would work.

I doubt I'll add that for a while, that would be quite a special case.


On Sun, Sep 25, 2016 at 10:24 PM, Eugene Kuzmitsky <tubo...@gmail.com> wrote:
Sure,

With VACHR approach, I believe, I can't record time intervals like 1h 25 min etc. In ledger-cli we can use such a format, I guess, but not here.

On Sunday, 25 September 2016 22:13:30 UTC-4, redst...@gmail.com wrote:
Beancount lets you define any currency you want on the fly. You can plot any of these in fava. Can you be specific on why the VACHR example does not work for you?

On Sunday, September 18, 2016 at 8:18:29 PM UTC-7, Eugene Kuzmitsky wrote:
Hi!

Being a Beancount user for a while, I'm just curious, is there any method of tracking hours in Beancount? I mean ledger-like feature, not just VACHR (from example) without fractional part of hours. It would be great to have this, so one can plot the time spent by category, say, in fava.

Thank you in advance,
Eugene

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Martin Blais

unread,
Feb 18, 2019, 1:03:00 PM2/18/19
to Beancount
On Mon, Feb 18, 2019 at 5:37 AM <mpl...@gmail.com> wrote:
Martin, did you ever end up implementing it?

No.


I would be also interested to have possibility to track time.

You already can; the only difference here is the input format.
"1.5" hours vs. "1h30" as the input.


mpl...@gmail.com

unread,
Feb 19, 2019, 3:11:40 PM2/19/19
to Beancount
Thanks for clarifying it.

I should have separate ledger for time tracking, correct? time and money should not be in same ledger...

mpl...@gmail.com

unread,
Feb 19, 2019, 5:40:29 PM2/19/19
to Beancount
Here is example to make it clear what i mean:

To do time tracking should i have separate ledger file? As i understand i can't track money and time in same ledger cause it's different "matter".

So i am thinking about creating time account:
Assets:Time

and accounts showing how i spend time, 
Expenses:Work:Programming
Expenses:Work:Design
Expenses:Hobbies:Running
Expenses:Hobbies:Reading
etc

Do i understand it right?

On Monday, February 18, 2019 at 1:03:00 PM UTC-5, Martin Blais wrote:

redst...@gmail.com

unread,
Feb 19, 2019, 11:31:51 PM2/19/19
to Beancount
It's simpler than you think. There's no reason why you'd need to have a separate input file. Time would be just another currency you made up (like VACHR), that can coexist with your other currencies (like USD). Instead of booking a 10 dollar expense, you'd book a 10 hour expense.

mpl...@gmail.com

unread,
Feb 20, 2019, 5:56:46 AM2/20/19
to Beancount
Thanks for your reply.

i understand the beancount part now. I would like to use fava too, and i was recommended to use separate ledger file "since fava assumes a primary operating currency for its charts".

Martin Blais

unread,
Feb 20, 2019, 8:26:44 AM2/20/19
to Beancount
You don't need a separate file, it doesn't matter.
Operating currencies is just a global list of currencies, doesn't have anything to do with files.
Its "primary" currency is probably just the first one on the list.


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages