hey @tarioch ,
thanks for asking, really appreciated! I am not sure if this is the right platform (i saw your github contribution to the smart importer…) I am solely interested in the postings prediction (= second account required to balance the transaction)
I think i followed the readme instructions in detail, and i have a working minimal example with all involved files available here. I start with my working non-smart-baseline:
(base) @:~/importers$ bean-extract Config.py bankstatement.csv
2017-01-02 * "randomtext" "Lastschrift randomtext52"
Assets:Liq:DKB:EUR -990.85 EUR
2017-01-02 * "randomtext" "Lastschrift randomtext53"
Assets:Liq:DKB:EUR -635.16 EUR
[...]
nice, it does the job. of course, the importer does not attempt to assign the target accounts.
now, modyfying only the config file applying what is stated in the readme of the github:
(base) @:~/importers$ bean-extract Config_smart.py bankstatement.csv
ERROR:root:Importer DKB ECImporter.extract() raised an unexpected error: extract() takes 2 positional arguments but 3 were given
ERROR:root:Traceback: Traceback (most recent call last):
File "/home/anaconda3/lib/python3.7/site-packages/beancount/ingest/extract.py", line 191, in extract
allow_none_for_tags_and_links=allow_none_for_tags_and_links)
File "/home/anaconda3/lib/python3.7/site-packages/beancount/ingest/extract.py", line 69, in extract_from_file
new_entries = importer.extract(file, **kwargs)
File "/home/anaconda3/lib/python3.7/site-packages/smart_importer/hooks.py", line 41, in patched_extract_method
imported_entries = unpatched_extract(file, existing_entries)
TypeError: extract() takes 2 positional arguments but 3 were given
;; -*- mode: beancount -*-
where the line imported_entries = unpatched_extract(file, existing_entries)
conflicts with the definition of the extract function of the importer : def extract(self, file_):
here is where I am stuck for the moment. would i have to update the beancount-dkb ec importer’s extract function accordingly?
config.py:
from beancount_dkb import ECImporter, CreditImporter
from smart_importer import apply_hooks, PredictPayees, PredictPostings
IBAN_NUMBER = 'DE23420304575000845261795' # your real IBAN number
DKBEC=ECImporter(
IBAN_NUMBER,
'Assets:Liq:DKB:EUR',
currency='EUR',
file_encoding='UTF-8',
)
# apply_hooks(DKBEC, [PredictPostings()]) # for smart, uncomment his line
CONFIG = [DKBEC]