Allow importers to specify formatting of postings
blais opened this issue · 2 comments
Original report by Martin Michlmayr (Bitbucket: tbm13, GitHub: tbm).
By default, bean-extract generates transactions like this:
2019-12-07 * "Anonymous" "Donation"
Assets:Receivable 100.00 USD
Income:Donations -100.00 USD
I know I can just pipe it into bean-format but I’m wondering if it would be possible to allow importers to format the postings, including spacing and amounts? (I know I can do amounts by just rounding to the precision I want).
In any ideal world, this would be per-posting? I like to align different postings with different spacing depending on their nature.
Good idea? Bad idea? Maybe I should just pipe the output to a script that formats it (that’s actually what I do now)
Original comment by Martin Michlmayr (Bitbucket: tbm13, GitHub: tbm).
How would the interface for specifying the formatting of each posting look like?
I’m not sure. I was thinking that postings should get values that describe how to format it, e.g. a format string, or a format for width and amount.
I think post-processing the output of the ingest framework is a much easier and flexible solution.
Yeah, maybe you’re right. I currently use an external script. Is that what you would recommend or would you somehow do it in beancount, e.g. wrapping some function? I’m curious what you think the most elegant solution would be.