Kitaab

Beancount: Plain text double entry accounting

finance dev

published 2022-10-15 00:41

updated 2022-10-15 01:35

Double entry accounting

Double entry accounting is a method of keeping track of money. Each transaction must equal 0. That is you take some money from one account, and add it to another. The sum of this transaction is always 0.

We have 4 kinds of accounts:

  • Assets (+)
  • Liabilities (-)
  • Income (-)
  • Expenses (+)
  • Equity (-) The sign in brackets represent the normal sign, the sign we generally expect the account to have (Though account signs can flip)

Equity is a bit difficult to explain, it doesn't hold particular meaning but arises from the need to 0 out all transactions. It basically holds "cleared" transactions and is the remainder when you minus assets from liabilities. A negative profit means positive real value.

Note that this is unrelated to the term “clearing transactions” which means acknowledging or marking that some transactions have been eyeballed by the bookkeeper and checked for correctness

Bean count syntax

{{{beancount 2016-12-06 * "Biang!" "Dinner" Liabilities:CreditCard -47.23 USD Expenses:Restaurants }}}

Lots of things to explain there

Muneem

My accounting bot that:

  • Downloads the csv (Using puppeteer?) from my bank account
  • Imports the csv file into my beancount file automatically