Hello,

I extended my importer to also work as transformer, applying the rules used 
at input on existing beancount files:

    entries, error, option_map = bc.loader.load_file(args.inputfile)

    transformed_entries = []
    for e in entries:
        transformed_entries.append(transform_txn(e) if type(e) == 
data.Transaction else e)

    with open(args.outputfile, "w") as f:
        bc.parser.printer.print_entries(transformed_entries, file = f)


My beancount files are organized as one main.beancount file which contains 
the open and pad directives and an account.beancount for each banking 
account.

To keep the transactions separate, I apply the transformation only on 
account.beancount (=args.filename). Naturally, there are several validation 
errors because of invalid accounts and failing balances. At this point, 
however, I don't care about the failing validations.

The problem is, that entries from load_file does not contain all 
transactions. I am not sure which transactions are omitted, but all 
balances are definitely left out. When I write out the transformed entries, 
information is lost.

How can I read in all entries of a file, get them as entries, but not 
perform any validation checks? Or otherwise, what is the best way to work 
around that?

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/fd082e96-693c-47ba-9f32-3425c7ff179c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to