3 ms·
I love fava/beancount, but I wish the language had some method of abstraction. I keep repeating myself, but don't see easy facilities for DRY, etc. e.g. When I
by philipswood 6y ago
I love fava/beancount, but I wish the language had some method of abstraction.
I keep repeating myself, but don't see easy facilities for DRY, etc.
e.g. When I do a debit card purchase I move currency from Whatnot:Cheque:Pending to the expense account, then later from Pending to Whatnot:Cheque:Current so for EVERY debit card transaction I'm copy-pasting a template and editing by hand.
Fava/beancount is so good though, that it's a local maximum - I'm a bit stuck.
- cobby 6y agoSounds like you need to develop a plugin or take a look at existing ones (for example effective date [1] might be helpful) [1] https://github.com/redstreet/beancount_reds_plugins/tree/master/beancount_reds_plugins/effective_date https://github.com/redstreet/beancount_reds_plugins/tree/mas...
- k_marussy 6y agoYou can easily create any kind of abstraction with beancount's programming interface [1]. I find it very comfortable, because I can manipulate the data structure directly (and not just the plain text as in e.g. vim). For example, here is a plugin that I wrote to "delay" a posting of a transaction to another date via an intermediate ("transfer") account [2] and its tests [3] that solves a problem pretty similar to yours (I should someday package my plugins properly and maybe put them on PyPI, but I haven't had the time yet). The beancount documentations also has a list of existing published plugins [4]. [1]: https://beancount.github.io/docs/beancount_scripting_plugins.html https://beancount.github.io/docs/beancount_scripting_plugins... [2]: https://linx.marussy.com/selif/v31rtbi5.py https://linx.marussy.com/selif/v31rtbi5.py [3]: https://linx.marussy.com/selif/tpwlujdk.py https://linx.marussy.com/selif/tpwlujdk.py [4]: https://beancount.github.io/docs/external_contributions.html https://beancount.github.io/docs/external_contributions.html
- kenada 6y agoThe place to do this would be in ingest, wouldn’t it? The ingest configuration is just Python, so one could conceivably write a module to assign accounts based on the incoming data. I know there was a module that would try to use ML to do that based on your account history. If you don’t want to do that, another option is hledger. I used that for a while before deciding to switch back to beancount for its ingest process. However, considering I have made no progress on that over the last year, I might just go back to using hledger. hledger’s ingest process is not as sophisticated as beancount’s. You can’t write arbitrary plugins like with beancount, but you can pattern match on the incoming text and assign accounts that way. You can also define automatic transactions in your books, which I found incredibly helpful for managing my budget.
- synack 6y agoI wrote a couple of small bash scripts for common entries to keep the typing to a minimum. ./purchase 10 AAPL 128.80