Plain text accounting
Beancount
ref:
- plain text accounting
- Blog de Cyril Deguet | Beancount ou la comptabilité pour les hackers
- Leo's Blog | No-Bullshit Beancount Introduction
Plain Text Accounting
(PTA) means doing accounting with plain text data formats and scriptable software
Beancount does not represent time, only dates. The minimal time interval is one day.
Most (not all) plain text accounting implementations use signed amounts instead of debits and credits. It has been a rather successful simplification, intuitive to most newcomers. It is also by far the preferred way to export a trial balance or general ledger account from any system to excel. It is the norm in the accounting industry.
Syntax directives
-
Open a new account. Accounts must be opened before being referenced.
2018-09-27 open Assets:EUR:Cash
-
Close an account. No transactions may post here after this date.
2017-02-28 close Assets:EUR:BankAccount
-
Transactions
- A basic transaction
txn
looks like this. Each line below a transaction is called aposting
.
2019-08-05 txn "Coffee" Assets:EUR:Cash -1.20 EUR Expenses:Coffee 1.20 EUR
- The sum of all postings must be 0. You may leave out one amount which will automatically get calculated
2019-08-12 txn "Supermarket" Assets:EUR:Cash -17.85 EUR Expenses:Groceries
- Instead of the keyword
txn
, you may use a flag to indicate a transaction. There are two available flags*
and!
; This is a complete transaction 2019-08-13 * "Train to work" Assets:EUR:Cash -2.50 EUR Expenses:Transportation:Train ; This is an incomplete transaction 2019-08-13 ! "Bus to Susan's House" Assets:EUR:Bank -2.00 EUR Expenses:Transportation:Bus
- It’s also possible to flag a single
posting
in a transaction:
2019-07-28 * "Concert Ticket Gorillaz" ! Assets:EUR:Bank -47.00 EUR Expenses:Entertainment
- A basic transaction
-
Define the price of a commodity for a given date
2019-08-06 price A0MW0M 5.41 EUR
-
Transactions can also be linked together
2014-02-05 * "Invoice for January" ^invoice-pepe-studios-jan14 Income:Clients:PepeStudios -8450.00 USD Assets:AccountsReceivable 2014-02-20 * "Check deposit - payment from Pepe" ^invoice-pepe-studios-jan14 Assets:BofA:Checking 8450.00 USD Assets:AccountsReceivable
-
A
Note
directive is used to attach a dated comment to the journal of a particular account2013-11-03 note Liabilities:CreditCard "Called about fraudulent card."
-
A
Document
directive can be used to attach an external file to the journal of an account2013-11-03 document Liabilities:CreditCard "/home/joe/stmts/apr-2014.pdf"
We can rename the account name
; Options pour renommer les catégories de base
option "name_assets" "Actif"
option "name_liabilities" "Passif"
option "name_equity" "Capital"
option "name_income" "Recettes"
option "name_expenses" "Depenses"
option "account_previous_balances" "SoldeOuverture"
option "account_previous_earnings" "Benefice:Precedents"
option "account_current_earnings" "Benefice:Courant"
So the printed balance sheet would be displayed as follows.
Formatting is critical
- Indent the second and following lines of each transaction. The first line of each transaction needs to be flush left.
- you need at least two spaces between the category ”Expenses:Household,” below) and the amount of the transaction (“20.00 USD”)
2017/01/15 Acme Expenses:Household[space][space]$20.00 Liabilities:CreditCard
Currencies must be entirely in capital letters (allowing numbers and some special characters, like “_” or “-”). Currency symbols (such as $ or €) are not supported. The syntax for a currency is a word all in capital letters like "USD, CAD, MSFT"
In beancount, a comment is declared by a semicolon ;
. Any text on a line after the character ;
is ignored.
Related resources:
- Plain Text Accounting Workshop
- reup pdf
- Awesome Beancount | curated list of resources for Beancount
- Hacker News | Beancount: Double-entry accounting from text files
- Hacker News | Simple Personal Finance Tracking with GnuCash
- Hacker News | Plain Text Accounting
- Hacker News | Plain Text Accounting, a guide to Ledger and friends
- GUI interface for Beancount
- Beancount Language Syntax
- Beancount | Command-line Accounting Cookbook
- Don't Sink Your First Attempts at Plaintext Accounting
- Tea Leaves | Double Entry Bookkeeping for Personal Finance
- PizzaBeer Engineering | Plain Text Accounting: How to do Signed Number Accounting
- My own notes about accounting basics
- Reddit | Do you think PTA has commercial applications in its future?
- tldr: PTA will not be suitable for accounting in business
- A business doesn’t care if its accounting data is in plain text, or JSON, or some binary format, as long as they have reasonable access to that data and a migration path available. For most of the commercial accounting products, they do.
- accounting in business needs
- the ability to do accrual, rather than cash-based accounting
- and a robust and efficient accounts payable and accounts receivable workflow - which again implies the existence of controls and approvals
Backlinks