On Wed, Dec 2, 2020 at 4:52 PM James Cook <[email protected]> wrote:
> On Mon, 30 Nov 2020 at 22:12, Aaron Lindsay <[email protected]> wrote: > >> I've been working on automating some accounting tasks lately and am >> curious for feedback from others on my approach, or ideas for doing it >> better in the future. >> >> I really dislike manually organizing my ledger file. I do still want to >> look over incoming transactions, but ideally would like everything else to >> be automated for me - I'd like transactions to be uniformly formatted and >> ordered. `bean-format` can take care of most of the former, but I've been >> using `bean-query example.beancount print` (wrapped in a shell script to >> preserve the options and remove trailing spaces) to do the ordering for me. >> This isn't ideal since it's actually modifying the ledger in the process. >> It seems like there are more possibilities for programmatically managing >> your .beancount file, too: I can imagine keeping prices separate from >> transactions, maybe automatically moving transactions for certain accounts >> to their own file, etc. >> >> Is there a better way to programmatically rewrite ledgers by hooking into >> pieces of the beancount internals today? If not, will v3 have any impact on >> this? I'm looking at the "Intermediate Parsed Data vs. Final List of >> Directives" section of the v3 document, but am not sure I grok the >> beancount internals enough to understand the implications there, if any. >> >> -Aaron >> > > Another example where programmatically modifying could be useful: > > Recently I wanted to add a stable unique ID to every posting to a certain > account (as a new metadata field). In my case I was able to hack something > together through plain text editing, but maybe if programmatic re-writing > were easy to do I could have saved some time. > > (The hash-based IDs available in bean-query won't work because I don't > want the ID to change if I edit the transaction. My goal is to eventually > export these to a different beancount ledger I have (joint vs. personal > accounting) using beancount-import.) > Idea: Auto generate a hash from just the part of the transaction that will not change even if you edit it. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhOeJeqqYPJNqT_h7RjqeOMhORDV%2B6u57EEwFuB%3DpdftpQ%40mail.gmail.com.
