Separate files

91 views
Skip to first unread message

Alen Šiljak

unread,
May 1, 2019, 9:07:37 PM5/1/19
to Beancount
A quick question regarding the current statet of multiple (or include) files and Beancount. I'm one of those who prefer to keep certain sections separate (accounts, prices, journal, commodities). This helps me also to track the changes separately.

With the convenience of plain-text-accounting I'm now considering exporting all my data from Quicken (a bit less than 20 years, I think) and checking how everything would work with PTA tools. So, naturally, I'm a bit concerned about the performance in that case. Separating files by year (or at least a decade!) would help. Include files would be good in order to create the summary files, which combine certain years and/or balance files from previous years.

Also, I'd really prefer to keep the price database outside the journal.

Additionally, coming from GnuCash, I even find the account open/close directives a bit of an extra functionality. I wouldn't mind if these were optional, kind of what ledger does with --strict. Also, open/close could be a property on an account object. Somehow I see these as metadata. It is not directly useful in the journal but can be made useful by a plugin that checks the validity dates, etc.
In reality I have an account which I closed last year but am still getting transactions on it. It's a brokerage which I no longer use but some tax and fee adjustments still get deposited from time to time. I assume this will stop at the end of this tax year but it shows that a closed account is not really a closed account. ;)

Note that none of these are feature requests. Just thinking out loud.

Justus Pendleton

unread,
May 1, 2019, 9:52:24 PM5/1/19
to Beancount

On Thursday, May 2, 2019 at 8:07:37 AM UTC+7, Alen Šiljak wrote:
A quick question regarding the current statet of multiple (or include) files and Beancount.

There's no actual question in your post that I can see.

I keep things split into 9 files, so if you have a question about it, I'm happy to try to answer.

Alen Šiljak

unread,
May 2, 2019, 5:57:05 AM5/2/19
to Beancount
You're right. I meant to ask, since looking at historical posts is a bit confusing, whether Beancount now supports multiple files and what is the correct syntax. Do the files need to be specified on the command line? Is there an include directive? If I split my exported file into several, how can I select which ones get loaded. That's basically the question. Thanks!

francois PEGORY

unread,
May 2, 2019, 6:06:52 AM5/2/19
to Beancount
Hello, 
I have currently split my beancount file in different files.
I have one main file with different other that are referenced in the main file with an included.
It is easier for editing but as far as I understand, in memory there are only one list of entry meaning that all the file referenced in the main file are always loaded.
If you don't want to load everything all the time , for me you need to :
Play with the file you include in the main file
Use pad depending when you want to not load everything.

About performance, if there are a part of the data that is not changed often, I have seen that put it in a different file seem a bit faster.

Regards

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/f946e5da-22fd-419b-aa72-8eed1b53f947%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alen Šiljak

unread,
May 2, 2019, 6:10:46 AM5/2/19
to Beancount
A benefit of this approach, for example, is to maintain a parallel set of books. I.e. initially export everything from GnuCash, separate into files, create adjustment files (for closing the accounts, previous years, etc.).
Afterwards, the export script can be run with the date filter, exporting the last month/year and appending to the ledger file, or into a separate file which gets imported in the assembly file. The book (assembly) file can take the balance statement from the previous years, the current-year ledger, and so on. Prices can be taken historically or just the recent year and so on. Lots of options.

On Thursday, 2 May 2019 03:52:24 UTC+2, Justus Pendleton wrote:

Patrick Ruckstuhl

unread,
May 2, 2019, 6:11:52 AM5/2/19
to bean...@googlegroups.com

There's an include directive


  1. include "subdir/file.beancount"

https://docs.google.com/document/d/1wAMVrKIA2qtRGmoVDSUBJGmYZSygUaR0uOMW1GV3YE0/edit#heading=h.86lelow4097r


Regards,

Patrick

--

Alen Šiljak

unread,
May 2, 2019, 6:43:40 AM5/2/19
to Beancount
Thanks, Francois. You do raise a few interesting points:


On Thursday, 2 May 2019 12:06:52 UTC+2, francois PEGORY wrote:
It is easier for editing but as far as I understand, in memory there are only one list of entry meaning that all the file referenced in the main file are always loaded.

Of course. This part is clear. However, (depending on what ones wants to report in the end, of course) it is possible to aggregate all the previous years in one "opening balances" file. This is something that "ledger equity" would do, in theory. There is also an option in fava that should do this but it does nothing for me. Anyway, hope that gets resolved soon, but you get the point. Avoiding parsing of years (I'm now challenging myself to export all of my historical data from Quicken, about 20 years of living in different countries) of data would help a lot with performance.
 
If you don't want to load everything all the time , for me you need to :
Play with the file you include in the main file
Use pad depending when you want to not load everything.

Exactly. That has just become one scenario on my todo list. :)
 

About performance, if there are a part of the data that is not changed often, I have seen that put it in a different file seem a bit faster.

That's interesting to know. I see the picklecache file generated and it helps the performance greatly. The data loading is about 200ms with it. But adding years of data is about to spoil that. 

Alen Šiljak

unread,
May 2, 2019, 6:46:04 AM5/2/19
to Beancount
Great, thanks! I missed that.
Guess I should help out a bit more with that documentation converter so that we get a searchable documentation copy.
Reply all
Reply to author
Forward
0 new messages