(reverse) chronological order?

122 views
Skip to first unread message

Vivek Gani

unread,
Nov 25, 2017, 4:34:51 PM11/25/17
to Beancount
Hi! I've been learning beancount and have been really impressed with the thought and structure that's gone into it. I'm a bit afraid of going into a bikeshedding argument here, but is there any issue with using beancount in reverse chronological order (newest first)? So far I haven't seen any argument against it, though all the examples skew towards a normal chronological order - is the rationale for that method so it's easier to 'append' new transactions?

Cheers,
Vivek

Vivek Gani

unread,
Nov 25, 2017, 5:45:02 PM11/25/17
to Beancount
After trying to fight to have a reverse chronological order setup, I ceded after realizing I'm going to be fighting how beancount ingest outputs data - namely the order of 'entries' returned from the extract method in an Importer is always going to be re-ordered in chronological order. Seems to be better to go for for convention over configuration.

As far as re-ordering my existing ledger back into chronlogical order, you can just use bean-query 'print' to do this:
$ bean-query myLedger.beancount  print > myLedger-chronological.beancount

Martin Blais

unread,
Nov 26, 2017, 10:32:49 AM11/26/17
to Beancount
About your prior question: Beancount completely disregards order. It is more or less thrown away; all the directives are sorted by date for processing.


On Sat, Nov 25, 2017 at 5:45 PM, Vivek Gani <vive...@gmail.com> wrote:
After trying to fight to have a reverse chronological order setup,

What difficulties did you encounter? There should have been none. Beancount throws away ordering (on purpose).

 
I ceded after realizing I'm going to be fighting how beancount ingest outputs data - namely the order of 'entries' returned from the extract method in an Importer is always going to be re-ordered in chronological order. Seems to be better to go for for convention over configuration.


As far as re-ordering my existing ledger back into chronlogical order, you can just use bean-query 'print' to do this:
$ bean-query myLedger.beancount  print > myLedger-chronological.beancount
 

On Saturday, November 25, 2017 at 1:34:51 PM UTC-8, Vivek Gani wrote:
Hi! I've been learning beancount and have been really impressed with the thought and structure that's gone into it. I'm a bit afraid of going into a bikeshedding argument here, but is there any issue with using beancount in reverse chronological order (newest first)? So far I haven't seen any argument against it, though all the examples skew towards a normal chronological order - is the rationale for that method so it's easier to 'append' new transactions?

Cheers,
Vivek

--
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/da1c17b5-aec1-47c7-8ebd-cb445933f77a%40googlegroups.com.

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

Martin Blais

unread,
Nov 26, 2017, 10:34:06 AM11/26/17
to Martin Blais, Beancount
And BTW, the only reason I say "more or less" is because the parser will attach meta-data that contains the original line number to the directives; but none of the processing makes use of it, other than the "bean-doctor context" command, which uses it for finding the closest transaction from a particular line number.

Vivek Gani

unread,
Nov 26, 2017, 1:07:08 PM11/26/17
to Beancount
Thanks for clarifying! Right after I sent my email yesterday I discovered the -r option in bean-extract! My initial email was reflecting on the export of my importer run via nosetool tests, where the .extract is the same no matter how the array of entries is ordered. 

I slept on it and decided to switch back to reverse chronological order - I'm still learning beancount's toolchain so the thing I'm staring at most is the ledger file itself, so at least for my own needs it's felt easier to have an ordering of...

- all account `opens` listed first as a preamble to serve as a catch-all reference of expense categories/etc.
- transactions newest first, which is arguably worse in some programmatic respects but feels more human-readable considering all the websites I log into (along with some of their csv exports) present data this way.

-Vivek


On Sunday, November 26, 2017 at 7:34:06 AM UTC-8, Martin Blais wrote:
And BTW, the only reason I say "more or less" is because the parser will attach meta-data that contains the original line number to the directives; but none of the processing makes use of it, other than the "bean-doctor context" command, which uses it for finding the closest transaction from a particular line number.

On Sun, Nov 26, 2017 at 10:32 AM, Martin Blais <bl...@furius.ca> wrote:
About your prior question: Beancount completely disregards order. It is more or less thrown away; all the directives are sorted by date for processing.
On Sat, Nov 25, 2017 at 5:45 PM, Vivek Gani <vive...@gmail.com> wrote:
After trying to fight to have a reverse chronological order setup,

What difficulties did you encounter? There should have been none. Beancount throws away ordering (on purpose).

 
I ceded after realizing I'm going to be fighting how beancount ingest outputs data - namely the order of 'entries' returned from the extract method in an Importer is always going to be re-ordered in chronological order. Seems to be better to go for for convention over configuration.

That's trivial to change; there's a command-line option to output the entries in reverse order.
See here:

As far as re-ordering my existing ledger back into chronlogical order, you can just use bean-query 'print' to do this:
$ bean-query myLedger.beancount  print > myLedger-chronological.beancount
 

On Saturday, November 25, 2017 at 1:34:51 PM UTC-8, Vivek Gani wrote:
Hi! I've been learning beancount and have been really impressed with the thought and structure that's gone into it. I'm a bit afraid of going into a bikeshedding argument here, but is there any issue with using beancount in reverse chronological order (newest first)? So far I haven't seen any argument against it, though all the examples skew towards a normal chronological order - is the rationale for that method so it's easier to 'append' new transactions?

Cheers,
Vivek

--
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,
Nov 26, 2017, 3:37:12 PM11/26/17
to Beancount
On Sun, Nov 26, 2017 at 1:07 PM, Vivek Gani <vive...@gmail.com> wrote:
Thanks for clarifying! Right after I sent my email yesterday I discovered the -r option in bean-extract! My initial email was reflecting on the export of my importer run via nosetool tests, where the .extract is the same no matter how the array of entries is ordered. 

I slept on it and decided to switch back to reverse chronological order - I'm still learning beancount's toolchain so the thing I'm staring at most is the ledger file itself, so at least for my own needs it's felt easier to have an ordering of...

- all account `opens` listed first as a preamble to serve as a catch-all reference of expense categories/etc.
- transactions newest first, which is arguably worse in some programmatic respects but feels more human-readable considering all the websites I log into (along with some of their csv exports) present data this way.

Absolutely valid motivations. There's nothing better about one order vs. the other. You should be able to organize your input file in the way that is the most convenient for you. I happen to order my by "sections" using org-mode as a folding/outline mode. That's how I navigate quickly within this gigantic text file.



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.
Reply all
Reply to author
Forward
0 new messages