I've used this plugin for a while to keep my hierarchy consistent. I don't have the time to clean it up thoughtfully enough to know if it will be useful to others, so I thought I'd simply share it as is in case it is useful.
Install via beancount-reds-plugins <https://github.com/redstreet/beancount_reds_plugins>. >From the README <https://github.com/redstreet/beancount_reds_plugins/tree/main/beancount_reds_plugins/opengroup#readme> : *# Opengroup: an EXPERIMENTAL plugin for Beancount* Inserts `open` statements for a set of accounts based on specified rules. For example, turns: ``` 2000-01-01 open Assets:Investments:Taxable:Midelity PARENT opengroup_cash_and_fees: "USD" opengroup_commodity_leaves_default_booking: "AAPL,VTI" opengroup_commodity_leaves_cgdists: "VTI" ``` into: ``` 2000-01-01 open Assets:Investments:Taxable:Midelity PARENT 2000-01-01 open Assets:Investments:Taxable:Midelity:USD USD 2000-01-01 open Expenses:Fees-and-Charges:Brokerage-Fees:Taxable:Midelity USD 2000-01-01 open Assets:Investments:Taxable:Midelity:AAPL 2000-01-01 open Income:Investments:Taxable:Dividends:Midelity:AAPL USD 2000-01-01 open Income:Investments:Taxable:Interest:Midelity:AAPL USD 2000-01-01 open Income:Investments:Taxable:Capital-Gains:Midelity:AAPL USD 2000-01-01 open Assets:Investments:Taxable:Midelity:VTI 2000-01-01 open Income:Investments:Taxable:Dividends:Midelity:VTI USD 2000-01-01 open Income:Investments:Taxable:Interest:Midelity:VTI USD 2000-01-01 open Income:Investments:Taxable:Capital-Gains:Midelity:VTI USD 2000-01-01 open Income:Investments:Taxable:Capital-Gains-Distributions:Short:Midelity:VTI USD 2000-01-01 open Income:Investments:Taxable:Capital-Gains-Distributions:Long:Midelity:VTI USD ``` ### Why use this plugin? If you like the benefit of a layer of error checking that you get by manually opening and closing accounts in Beancount, this plugin offers a way to get that benefit while being compact and consistent in your account declarations. Opening groups of accounts based on metadata like the above helps with: - ensuring your accounts follow consistent naming conventions - expression density (fewer open statements) - ease of adding new funds (no need to remember all the corresponding accounts to open and their conventions; simply add the new ticker to the metadata list) -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/d4d555f0-cba7-408d-8f2c-5b4d057149e8n%40googlegroups.com.