Generate new account directives for bean-extract

31 views
Skip to first unread message

aaron....@gmail.com

unread,
Aug 10, 2020, 4:38:31 PM8/10/20
to Beancount
When I run bean-extract, if the importers generate transactions with new accounts, it'd be nice if they also generated directives for those new accounts. I know I could just add account directives as bean-check flags them, but I'm a programmer so what the heck.

It seems like the best place for this might be an extra hook.

a) Does this seem like a good approach? 
b) Is there a way to add a hook without re-implementing the beancount.ingest.extract.run method and argument parsing?

Martin Blais

unread,
Aug 10, 2020, 10:12:41 PM8/10/20
to Beancount
On Mon, Aug 10, 2020 at 4:38 PM <aaron....@gmail.com> wrote:
When I run bean-extract, if the importers generate transactions with new accounts, it'd be nice if they also generated directives for those new accounts. I know I could just add account directives as bean-check flags them, but I'm a programmer so what the heck.

It seems like the best place for this might be an extra hook.

a) Does this seem like a good approach? 

Yes and no. 
Yes, this logic could in theory live in the extraction code.
Maybe no, because it's really the exception / rare when new accounts get imported and usually you want to keep an eye on those Open directives and perhaps locate them somewhere else. It won't save you much time unless you have some special use case. 


 
b) Is there a way to add a hook without re-implementing the beancount.ingest.extract.run method and argument parsing?


Note you could  also do that in your custom importers, you can insert any directive in the returned stream, not just Transactions


 


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/beancount/5e55d0b9-88df-4c6f-a9e3-b1884fef4801o%40googlegroups.com.

Aaron Stacy

unread,
Aug 10, 2020, 10:45:28 PM8/10/20
to bean...@googlegroups.com
Thanks Martin!

You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/NMb1dlYKd9Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhPwAsdU397gfsmBLGjt3hQA0F1kekxrYu_Lr%3DvKrb7T%2BQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages