Here I will describe various ideas an how to improve your Beancount experience and solve some issues that may be commonly faced. Make sure to check Cookbook & Examples of the original documentation. Below I’ll provide my library choices, solutions and recipes.

Editing transactions

If you’re using beancount-import, feel free to modify generated transaction statements at any time. For example, if part of the single bank transaction should be classified to a different category, just edit it manually and break the amounts correspondingly. Add tags to track transactions easier, add comments or another metadata if that could help you later.

For example, the original imported transaction may look like this:

2024-03-11 * "Store" "Store purchase at XXXXXXX" ^tr_id12345
    Assets:Bank:Cash   -75.2 USD
        date: 2024-03-11
        source_desc: "Store purchase at XXXXXXX"
    Expenses:Shopping 75.2 USD

And you may edit it to look like this:

2024-03-11 * "Store" "Store purchase at XXXXXXX" ^tr_id12345 #irregular #share-Alice
    Assets:Bank:Cash   -75.2 USD
        date: 2024-03-11
        source_desc: "Store purchase at XXXXXXX"
    Expenses:Shopping 15 USD
    Expenses:Gifts 20 USD
    Expences:Groceries

Which will result in better distribution between expenses categories, and also additionally tagged for plugins and your own convenience.

Just don’t touch the metadata that beancount-import adds itself, it uses it to match against previously imported data.

Group-tagging transactions

If you don’t like to manually add a lot of tags but would rather add rules to add tags automatically to cover some common cases, take a look at the filter_map plugin.

Tracking shared expences

You can always split the Expenses transaction leg into several, some of them may be something like Liabilities:Person. I think Liabilities accounts category is the best to use because it doesn’t participate in Expenses and Income but also doesn’t show directly in your Assets.

To simplify things further, beancount_share works perfectly. You can use simple and intuitive tags to cover the most common use-cases. Just follow the README description in the repo.

Transaction splitting

Let’s say you pay for something in quarterly installments. That will mean that in your monthly report every third month will have a spike in expenses. If you want to avoid this you can distribute the expense evenly between these three months. The beancount_interpolate plugin allows to do this.

Note that in some sense you’re losing factual precision of your data. It may be better for your expense analysis but less accurate for your account graphs. You may enable or disable plugin in the config depending on what you need at the time.

Transaction happening at different date

Let’s say for some reason you missed your monthly payment for something and paid it in the next month for two months in a row (using two transactions to do that). The actual payment for the accounts happened on the same date but looking at the expenses you would like for each payment to associate with specific month that payment was for.

You can check out the effective_date plugin that arranges splitting your transaction in a specific way to make this possible.

Alternatively, you can also use beancount_interpolate and specify split: "day @ 2024-07-03 / day" to just “move” transaction to a different date. It will not be actually split as day / day means split over a day with a step of a day (so 1 step in total) but the new generated transaction will appear at specified date.

Tracking subscriptions

It’s a good idea to keep an eye on the services you subscribe to.

First, I use a #recurring tag and tag all transactions that are happening regularly (monthly, quarterly, yearly, etc). It has two effects:

  • There’s a link on the left to see the #recurring transactions journal. It’s a good place to get an overview of recent recurring transactions and maybe decide to cancel some.
  • A couple of pages under Dashboards will separate #recurring amounts into a separate category so you can estimate what percentage of your expenses is happening regularly

You can largely avoid tagging each such transaction manually by using the filter_map plugin. For example, there’s a recipe for a #subscription-year tag that will split your yearly payment into monthly instalments and tag them as recurring.

Tracking quick shared expenses and refunds

Sometimes there are transactions that you will later have fully or partially refunded or paid back. In case of returns and cancelled orders it will be a single transaction that reverts the original (in this case I just use Assets:TemporaryHold account), in more complex cases (for example, buying a gift for someone with a group of friends) it will be multiple transactions. The tag_pending plugin describes one way to handle this. I use the following recipe that I found more convenient.

Start by creating an additional configuration for beancount_share plugin (in the main.bean):

plugin "beancount_share.share" "{
  'mark_name': 'qs',
  'meta_name': 'shared',
  'open_date': '1970-01-01',
  'account_debtors': 'Liabilities:QuickShare',
  'account_creditors': 'Liabilities:QuickShare',
}"

and use it as following:

2024-03-10 * "Gift for Bob shared by 4 people" #qs-GiftForBob-75p
  Assets:Bank:Cash  -150 USD
  Expenses:FullyShared   150 USD

2024-13-12 * "Return of Peter's share for Bob's gift" #qs-GiftForBob-100p
  Assets:Physical:Cash  -37.5 USD
  Expenses:FullyShared   37.5 USD

You can filter by Liabilities:QuickShare accounts in Fava’s Trial Balance and make sure all of these eventually balance out to zero.

Dashboards

There’s a huge potential to customize your Beancount experience and make it even more personally useful using Fava dashboards: https://github.com/andreasgerstmayr/fava-dashboards. The example example file is very useful and you can get a lot by just copy-pasting sections from it and adapting for your needs. The one provided with Lazy Beancount is based on this example and already somewhat customized.

The new pages are not too hard to create and augment with JavaScript + echarts. You can use browser console for debugging these.

Scripting

As well as getting data in dashboards, of course you can also just launch a Jupyter Notebook, fetch data from the ledger with simple or more sophisticated BQL query and run further analysis with pandas:

from beancount import loader
from beancount.query import query
import pandas as pd

q = """
    SELECT year, month, CONVERT(SUM(position), 'USD', LAST(date)) AS value
    WHERE account ~ '^Expenses:EatingOut' AND NOT 'travel' IN tags AND year >= {}
    GROUP BY year, month
"""
entries, errors, options_map = loader.load_file('main.bean')
row_types, rows = query.run_query(entries, options_map, q, 2024)
df = pd.DataFrame(rows)
df['value'] = df['value'].map(lambda v: v.get_only_position().units.number)

Or another example.

By the way, Fava provides a nice interface for running BQL queries on your ledger with help, help attributes and help targets commands being a good place to start. Some more examples here.

Budgeting

I don’t do budgeting personally. You can, for example, use http://localhost:5003/beancount/trial_balance/?time=month (click on Expenses) to see expenses for the current month (but for that to be reliable you obviously need to import recent transactions yourself). Also the default Income/Expenses view in Dashboards can help you visualize how things are going month by month. Or more detailed view via http://localhost:5003/beancount/income_statement/ is always available.

If you want to get more specific with something similar to envelope budgeting / YNAB, however, the things are not optimal at the moment. The Fava’s Budget feature seems to be broken in the recent versions. There are a couple of solutions expanding on that functionality. Unfortunately, at the time I checked https://github.com/polarmutex/fava-envelope didn’t support multiple currencies and https://github.com/scauligi/refried wasn’t updated to work with the latest Fava. I will try integrating one of these if that changes in future.

There’s also another approach described in beancount_allocate which I haven’t personally tried yet.

Migrating data and systems

You fully own the data and you also can find a multitude of existing importers/exportes for other systems. For example, https://github.com/beancount/beancount2ledger/ is supposed to work to convert data to ledger/hledger if you wanted to, and then you could make it work to try out Paisa.

Also check out other converter tools.

Inflation indices

For example, you could take some data from https://www.ons.gov.uk/economy/inflationandpriceindices/datasets/consumerpriceindices (if you live in the UK) or maybe even something like https://www.economist.com/big-mac-index and convert it to commodity price statements and then use it as a currency to track actual value of assets related to inflation more precisely.

Other libraries and tools

You can find even more useful potential integrations here: https://beancount.github.io/docs/external_contributions.html. If you think something would be really helpful to distribute as a part of lazy-beancount, please create a ticket.