beancount / smart_importer

Augment Beancount importers with machine learning functionality.
MIT License
246 stars 28 forks source link

Bypass specific transactions. #92

Closed gety9 closed 4 years ago

gety9 commented 4 years ago

Guys hi,

Is it possible to bypass transactions? I checked documentation / previous issues and did not find information on it.

I am working on importer where: -some transactions i will sum up and present as single aggregate transaction with complete postings and will not need smart_importer predictions; -remaining transactions will have only 1 leg and will need smart_importer predictions.

Basically CSV report file has numerous ecommerce sales, and spendings combined in CSV one file, so i would like to aggregate sales in one transaction, but keep spending transactions separate.

Is it possible to make smart importer bypass aggregated transaction, but do predictions for remaining one? As i understand if aggregated transaction will have more than 1 leg then it should be ignored anyone, right? Another option i see can create 2 importers, first to create aggregate transaction, second to work on remaining transactions, and to apply smart importer hook only to second one.

What's the better approach?

tarioch commented 4 years ago

Yes, if there is more than one trx it's ignored. So it should just work.

gety9 commented 4 years ago

if there is more than one trx it's ignored.

you mean, if there is more than one posting it's ignored, right?

tarioch commented 4 years ago

sorry, yes, See https://github.com/beancount/smart_importer/blob/7f2a759cf5ad2d67d13bba5d70f361df0e289a8b/smart_importer/entries.py#L8

gety9 commented 4 years ago

got, it. Thank you for the help. Closing.