Example workflow for beangulp for beancount 3?

770 views
Skip to first unread message

Eric Morgan

unread,
Oct 1, 2024, 5:02:53 PM10/1/24
to Beancount
My workflow with beangulp is that I have a script that runs import.py for each bank

#!/usr/bin/env python3

from importers.some_bank import importer as some_bank
import beangulp
importers = [
    some_bank.Importer(),
]
hooks = []
if __name__ == "__main__":
    ingest = beangulp.Ingest(importers, hooks)
    ingest()


The script then copies the imported files to an folder for imported files.

I'm sure this workflow is not ideal. Is there any repo that showcases a better workflow when using beangulp?

Martin Blais

unread,
Oct 5, 2024, 3:51:02 PM10/5/24
to bean...@googlegroups.com
What's not ideal about it?
(Seems fine to me.)

--
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/1a984943-6ff9-4dc0-b0cc-31a1e879dd0fn%40googlegroups.com.

Daniele Nicolodi

unread,
Oct 6, 2024, 6:46:04 AM10/6/24
to bean...@googlegroups.com
On 02/10/24 05:02, Eric Morgan wrote:
> My workflow with beangulp is that I have a script that runs import.py
> for each bank

Why one script for each bank? The framework is written with the intent
of allowing multiple types of transactions sources to be processed at
the same time.

> The script then copies the imported files to an folder for imported files.

This is automated by the framework, just use the 'archive' command.

> I'm sure this workflow is not ideal. Is there any repo that showcases a
> better workflow when using beangulp?

I'm not sure what you mean. beangulp does not try to impose any
particular workflow. However, if you are sure that what you are doing is
not idea, you most likely have identified shortcomings in your approach.
If you can explain what you would like to do more efficiently, we may be
able to suggest a way to do it. Otherwise, it is hard to provide any hint.

Cheers,
Dan

Martin Blais

unread,
Oct 6, 2024, 11:57:42 AM10/6/24
to bean...@googlegroups.com
On Sun, Oct 6, 2024 at 6:46 AM Daniele Nicolodi <dan...@grinta.net> wrote:
On 02/10/24 05:02, Eric Morgan wrote:
> My workflow with beangulp is that I have a script that runs import.py
> for each bank

Why one script for each bank? The framework is written with the intent
of allowing multiple types of transactions sources to be processed at
the same time.

+1
I hadn't seen "for each bank", but indeed, just put all your importers in the same script.



Vasily M

unread,
Oct 10, 2024, 11:09:47 AM10/10/24
to Beancount
Hi Eric,

If you want additional examples and possible improvements, I'll add a couple of links as I was doing similar research recently.

First, uabean that has been recently mentioned in these groups: https://github.com/OSadovy/uabean/blob/master/my_import.py.sample . Besides the example that follows the already mentioned approach, it has definition for "downloaders".

Interesting question is how to make it work with Fava: https://fava.pythonanywhere.com/example-beancount-file/help/import, which I haven't researched in detail (it seems to refer to pre-beangulp interfaces which are slightly different so it may be not up-to-date).

Then, there's https://github.com/redstreet/beancount_reds_importers that, I believe, uses its own structure but handles all of the same steps. I didn't look into it deeply only because it didn't have any of the specific importers I needed the most.

Finally, there's https://github.com/jbms/beancount-import which I ended up using because of the provided conveniences, in particular some auto-classification and a mechanism for matching source and processed data. My example (without any ambition to be perfect or canonical) can be found here: https://github.com/Evernight/beancount-importers. The particular case of usage described here in more details: https://lazy-beancount.xyz/docs/stage2_expenses/automated_import/. There's refactoring that needs to be done but the whole setup is working.

I've also seen https://github.com/LaunchPlatform/beanhub-import that seems to be a more recent approach that skips the UI step in favour of the fully automated and pre-configured treatment.

Hope it helps!
Reply all
Reply to author
Forward
0 new messages