New plugin: rename_accounts

169 views
Skip to first unread message

Red S

unread,
May 1, 2022, 2:11:40 AM5/1/22
to Beancount
This plugin is actually a couple years old, but I just realized I never shared it here. This is a completely trivial, and somewhat hacky plugin that I personally find surprisingly useful.


rename_accounts plugin for Beancount

Plugin that renames accounts, given a list of account pairs to rename.

This is useful when one wants two different views (reports) into the same set of transactions. Renames can be turned on or off relatively easily (by manually commenting them out in your Beancount plugin directive) depending on the type of reporting desired. Here is an example where this is useful:

Expenses:Taxes ---rename--> Income:Taxes

This rename allows taxes to avoid cluttering and dominating the Expense reports (and thus rendering them less useful), and simultaneously reports net (after-tax) income. Without the rename, of course, the view of gross income and expenses including taxes becomes available.

Here are a few other examples from the Beancount mailing list where renaming accounts helps switch between a cash flow view and a tax view.

Of course, the right set of queries can also give you these reports. However, renaming allows you to take advantage of standard, built-in reporting tools and UIs. For example, Fava's UI hierarchy and associated visualizations (treemaps, sunburst plots, bar plots across time, changes by year, etc.) are not available for queries. Renaming solves this problem.

Reply all
Reply to author
Forward
0 new messages