Am 10.05.19 um 02:23 schrieb Martin Blais:> I read your message twice. I 
don't understand what you're trying to do.
Sorry, for being unclear. I try to demonstrate it:

  % cat main.beancount 
option "operating_currency" "EUR"

2018-05-01 open Equity:Opening-Balances

2018-05-01 open Assets:Giro
2018-05-01 open Expenses:Unknown

2018-05-01 pad Assets:Giro Equity:Opening-Balances
2018-05-02 balance Assets:Giro 10.00 EUR

include "giro.beancount"

  % cat giro.beancount 
2018-05-11 * "Someone" "Somedesc"
  Assets:Giro       100.00 EUR
  Expenses:Unknown            

2018-05-12 balance Assets:Giro 110.00 EUR

  % bean-check main.beancount 

Everything is fine.

Now, in Python:

  entries, errors, options = beancount.loader.load_file("main.beancount")

entries contains all entries, errors is empty.

But if I load the giro.beancount file:

  entries, errors, options = beancount.loader.load_file("giro.beancount") 

errors contain Balance and Validation errors. Sure, because the account 
declarations and padding from main.beancount are missing.

The problem I have, is that entries does not contain all entries from the 
file. Here, it contains only one transaction, the balance is omitted.

Now, if I do some changes on the entries and write them out again using

  beancount.parser.printer.print_entries(transformed_entries, file = f)

balances are not written to the file and information is lost.

Because I want to read all entries of one file (which not necessarily 
validates) and write them out to the same file, this is a problem for me.

A workaround I see, is to read in main.beancount and write out the entries 
to different files based on entries[6].meta["filename"]. Basically 
rewriting the entire ledger.

I hope, I was able to express my problem.

Best Thanks,
Florian

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/fa979ce5-df09-4b3f-a758-f529920c4ba3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to