On Mon, Aug 10, 2020 at 4:38 PM <[email protected]> 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
> <https://github.com/beancount/beancount/blob/89dea7c5045fa145ac9ccc16110e3549ea7d69e3/beancount/ingest/extract.py#L201>
> .
>
> 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?
>

https://github.com/beancount/beancount/blob/master/examples/ingest/office/example_import.py

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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/5e55d0b9-88df-4c6f-a9e3-b1884fef4801o%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/5e55d0b9-88df-4c6f-a9e3-b1884fef4801o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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%2BhPwAsdU397gfsmBLGjt3hQA0F1kekxrYu_Lr%3DvKrb7T%2BQ%40mail.gmail.com.

Reply via email to