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/ecb710e3-8c6a-4539-bbfb-f5adb925295cn%40googlegroups.com.

Reply via email to