beancount/beangulp

Create a section classifier for new transactions

blais opened this issue · 1 comments

blais commented

Original report by Martin Blais (Bitbucket: blais, GitHub: blais).


There's nothing like that in the Beancount codebase. I've thought about building something to automatically insert imported transactions in the right "section" (I personally use org-mode, where each section corresponds to an institution and its related group of accounts) but it's unclear whether that would generalize.

I think you could turn this into a simple classification problem. Given some syntax for splitting up an input file into sections (e.g., some regular expression matching on a title or separator), you now have groups of transactions and inputs. Somehow reduce this to a simple model for classifying which section an incoming transaction matches with highest probability and insert it there. Or more appropriately - since transactions are imported in groups - find the section that best matches all the transactions in the imported files and insert at the end there.

On Sun, Mar 11, 2018 at 12:28 PM, Michael Droogleever droogmic@gmail.com wrote:
I believe it is against the design of beancount, but is there any existing code which attempts to add transactions to an existing beancount file. Assuming the entries in the file are grouped by asset account, it would need to append the entry to the subsection of entries all from the same account.

blais commented

Original comment by Dominik Aumayr (GitHub: aumayr).


Fava already does have this functionality (and code), see the "insert-entry" option: https://fava.pythonanywhere.com/example-with-budgets/help/options/

How it works: You can add custom "insert-entry" entries with a RegEx as the value, which determines where in the file new transactions will be added. I use this constantly, and added these custom entries in different sections in my beancount files, corresponding to different accounts.