MoritzR / fints2ledger

A tool for downloading transactions from FinTS banking APIs and sorting them into a ledger journal
MIT License
27 stars 8 forks source link

FR: Ability to auto-match transactions #5

Closed varac closed 3 years ago

varac commented 4 years ago

buchhaltung has a Semi-automatically match transactions to accounts using Bayesian classification. It didn't work too well for me but still it's suggestions were 75% right.

I'd be in favor of a config file auto automatic matching/suggestions like shown in the https://github.com/jamatute/beancount-importer README:

- regexp: '.*RISEUP.*'
  account: 'Expenses:Bills:Email'
  payee: 'Riseup'
  description: 'Donation to Riseup'
MoritzR commented 4 years ago

Good suggestion! I have kind of wanted something like this myself but never found enough reason to implement it. I tested a bit and found the most usable version for me was to automatically match fields, so that entire entries can be skipped without having to confirm a suggestion.

I updated the readme at https://github.com/MoritzR/fints2ledger#automatically-matching-transactions and pushed a new version (0.6.0)

I am interested to know how that works for you.

varac commented 3 years ago

Works super well, much better than buchhaltung. The only feature i'm missing is automatically accepting original fields.

If I have this matching rule:

- match:                                                             
    payee: "My Bank"
    purpose: ".*monthly fee.*"                                  
  fill:                                                              
    credit_account: "Expenses:Bank"

I will always be asked for the purpose, which I can accept with hitting enter. But I'd like to auto-accept the purpose in this case, so sth like this would be awesome:

- match:                                                             
    payee: "My Bank"
    purpose: ".*monthly fee.*"                                  
  fill:                                                              
    credit_account: "Expenses:Bank"
    purpose: "<ORIGINAL>"

Or whoever the keyword should be named to indicate to accept the original purpose.

MoritzR commented 3 years ago

You can check out version 0.8.0

For me, accepting the original purpose is actually what I want to do most of the time. For this reason I went with that being the default. If the prompt is needed for a specific field, the empty value is the magic value for that. I started writing a changelog, which you can check for a more detailed explanation.

I hope this way of doing this fits you aswell!

varac commented 3 years ago

Work well, sorry for the lag.