Hi,
New version of smart_importer has now this functionality out of the box.
from your_custom_importer import MyBankImporter
from smart_importer import PredictPayees,PredictPostings
CONFIG = [
MyBankImporter('whatever','config','is','needed'),
]
HOOKS = [
PredictPostings().hook,
PredictPayees().hook
]
Besides the implementation as a standard hook, there is also a new
(hopefully much simpler and clearer) way to just wrap single importers.
from your_custom_importer import MyBankImporter
from smart_importer import PredictPayees,PredictPostings
CONFIG = [
PredictPostings().wrap(
PredictPayees().wrap(
MyBankImporter('whatever','config','is','needed')
)
),
]
HOOKS = [
]
See https://github.com/beancount/smart_importer/ for details
If you're using smart_importer together with fava, please make sure to
upgrade to the latest release >= v1.30.3 (there was a change required
for fava to run the beangulp hooks which have more arguments).
Regards,
Patrick
On 11.03.2025 18:58, 'Patrick Ruckstuhl' via Beancount wrote:
Hi,
Yes that's it. If someone would be willing to create a pr for making
smart importer work with the beangulp hooks instead of the old way,
I'm sure we can get it merged and released quickly. At the moment I'm
busy with other stuff so I don't have the capacity to look into doing
the changes myself.
Regards,
Patrick
On March 11, 2025 2:29:27 PM GMT+01:00, "[email protected]"
<[email protected]> wrote:
Hi,
Just an addendum to my earlier message. To get
https://github.com/beancount/smart_importer to work with
https://github.com/prabusw/beancount-importers-india/blob/master/prabu/import_prabu.py,
the following changes have to be made:
+from smart_importer import apply_hooks, PredictPayees,
PredictPostings
+smart_icici =
icici.IciciBankImporter("Assets:IN:ICICIBank:Savings","XXXX")
+apply_hooks(smart_icici, [PredictPostings(), PredictPayees()])
importers = [
- icici.IciciBankImporter("Assets:IN:ICICIBank:Prabu","XXXX"),
+ smart_icici,
..
]
Basically the individual importer has to be taken out and assigned
a new name, applied hook and has to be called with new name for it
to work with smart_importer. I'm not sure if i've understood
correctlty, but this was quite difficult for me to understand
initially. After using https://github.com/hoostus/beangulp-hooks,
i could go back and get the above working.
Thanks again to everyone,
Prabu
On Tuesday, 11 March 2025 at 18:12:54 UTC+5:30 [email protected]
wrote:
Hi Justus,
A few hours ago i tried using the
https://github.com/beancount/smart_importer with my beangulp
based importer(
https://github.com/prabusw/beancount-importers-india/blob/master/prabu/import_prabu.py)
to handle 1000+ postings from a bank account and i could not
get it working.
I come here to search and find your posting and
https://github.com/hoostus/beangulp-hooks works perfectly.
I just made two changes to the above import_prabu.py file as
shown below and it works great.
+ from hoostus.beangulp.hooks import predict_posting
-hooks = [process_extracted_entries,]
+hooks = [predict_posting.simple_hook]
Thank you so much for creating and sharing here in the mailing
list. Hope these changes get merged to
https://github.com/beancount/smart_importer so that it
supports beangulp. I'm still finding it difficult to
understand the changes between v2 and v3 as i don't have
programming background.
Regards,
Prabu
On Thursday, 6 March 2025 at 12:39:11 UTC+5:30
[email protected] wrote:
I searched previous posts but couldn't find anyone that
had contributed a beangulp hook that mimics the "predict
postings" thing from legacy smart_importer.
This took me way longer than expected since I have no idea
what I'm doing but it's been working for me for a few days.
https://github.com/hoostus/beangulp-hooks
--
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 visit
https://groups.google.com/d/msgid/beancount/BAD95D51-D9B2-4E48-9AE4-A1B032B81FCB%40tario.org
<https://groups.google.com/d/msgid/beancount/BAD95D51-D9B2-4E48-9AE4-A1B032B81FCB%40tario.org?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 visit
https://groups.google.com/d/msgid/beancount/2afb51a4-3dbe-467d-a2d3-5403cbfac7f0%40tario.org.