Accounting Dictionary for Beancount Users (A–Z)
· 17 minuts de lectura
Welcome to your developer-friendly guide to accounting concepts, tailored specifically for the world of plaintext accounting with Beancount. This dictionary bridges the gap between traditional finance terminology and Beancount's unique syntax, directives, and tools. Whether you're a seasoned developer new to accounting or a finance pro exploring plaintext methods, this A–Z reference will help you master your ledger.
How to Read Each Entry
Each term is broken down into three parts for clarity:
- Conceptual Meaning — A simple, jargon-free explanation of the accounting or finance idea.
- Beancount Implementation — How the concept is represented or handled in Beancount, whether through directives, options, command-line tools, or reports.
- Example — A minimal, copy-paste-ready code snippet to illustrate the concept in a
.beancount
file.
Note: All examples adhere to the canonical syntax and behavior described in the official Beancount documentation.
A
Account
- Conceptual Meaning: A named category or "bucket" used to track the balance of something you own, owe, earn, or spend. Examples include your checking account, credit card, salary, or grocery expenses.
- Beancount Implementation: Account names are hierarchical and separated by colons (e.g.,
Assets:Bank:Checking
). Every account must belong to one of the five root account types:Assets
,Liabilities
,Equity
,Income
, orExpenses
. - Example:
2014-05-01 open Assets:US:BofA:Checking USD
Accounting Equation
- Conceptual Meaning: The fundamental formula on which all accounting is based: Assets = Liabilities + Equity. It means that everything a business or individual owns (assets) is financed by either debt (liabilities) or the owner's own funds (equity).
- Beancount Implementation: This equation is automatically and rigorously enforced. Every transaction must be zero-sum, meaning the total of all its postings must equal zero. This design makes it impossible to create an unbalanced entry.
Accrual vs. Cash Basis
- Conceptual Meaning: Two methods of recording transactions. Accrual basis records revenue when it's earned and expenses when they're incurred, regardless of when money changes hands. Cash basis records them only when cash is actually received or paid.
- Beancount Implementation: Beancount supports both methods. Accrual accounting is achieved by using
Assets:Receivables
for money owed to you andLiabilities:Payables
for money you owe. Cash basis accounting simply omits these intermediate postings.
Amortization / Depreciation
- Conceptual Meaning: The process of systematically spreading the cost of a tangible (depreciation) or intangible (amortization) asset over its useful life. For example, writing off the value of a company laptop over three years.
- Beancount Implementation: This is handled by creating periodic transactions that move a portion of the asset's cost from its asset account to an expense account (e.g.,
Expenses:Depreciation
). This can be automated using scheduled transaction plugins.
B
Balance Assertion
- Conceptual Meaning: A checkpoint to confirm that your recorded balance for an account matches the real-world balance (e.g., from a bank statement) on a specific date. This is the core of reconciliation.
- Beancount Implementation: The
balance
directive asserts an account's total value at the start of the specified day. Beancount will raise an error if the calculated balance from all prior transactions does not match the asserted amount. - Example:
2024-01-31 balance Assets:US:BofA:Checking 154.20 USD
Balance Sheet
- Conceptual Meaning: A financial statement that provides a snapshot of a company's or individual's financial health at a single point in time, showing assets, liabilities, and equity.
- Beancount Implementation: The web interface Fava provides an interactive Balance Sheet report. You can also generate one using Beancount's query language (
bean-query
or the newer standalone Beanquery tool).
Booking Method (Inventory Matching)
- Conceptual Meaning: The method used to decide which previously purchased lots of an asset (like shares of a stock) are considered "sold" when a portion is divested. Common methods are FIFO (First-In, First-Out) and LIFO (Last-In, First-Out).
- Beancount Implementation: The booking method can be set globally with
option "booking_method" ...
or on a per-account basis in itsopen
directive. Beancount's default is STRICT, which requires you to explicitly state which lot is being sold if there's any ambiguity. Other options include FIFO and LIFO.
Budget
- Conceptual Meaning: A financial plan that estimates income and expenses over a specified period.
- Beancount Implementation: Budgeting is not a native feature of Beancount's core language. It is primarily implemented in the Fava web interface, which supports its own
custom
budget directives, or through community-developed plugins likefava-envelope
.
C
Capital Gain / Loss
- Conceptual Meaning: The profit (capital gain) or loss (capital loss) resulting from the sale of a capital asset, such as stocks or real estate.
- Beancount Implementation: When you post a transaction that reduces a position (e.g., selling stock), Beancount automatically matches it against existing lots based on the booking method. You then post the calculated gain or loss to an appropriate income account, like
Income:CapitalGains
.
Chart of Accounts
- Conceptual Meaning: A comprehensive, structured list of all accounts in the general ledger.
- Beancount Implementation: Your Chart of Accounts is implicitly defined by all the
open
directives and account names used throughout your ledger files. There is no separate file to define it.
Commodity / Currency
- Conceptual Meaning: The unit of value being tracked. This can be a traditional currency (USD, EUR), a stock (AAPL), a loyalty point (AIRMILE), or any other quantifiable unit.
- Beancount Implementation: All such units are called "commodities." You can optionally declare them using the
commodity
directive to attach metadata, such as a full name or formatting rules.
Cost (Lot Cost)
- Conceptual Meaning: The original price paid per unit for a specific purchase of an asset (a "lot"). This is crucial for calculating capital gains.
- Beancount Implementation: Lot cost is specified using curly braces
{}
on a posting. This information—cost, date, and an optional label—is attached to the lot and used for future matching. - Example:
2025-04-01 * "Buy Stock"
Assets:Brokerage 25 HOOL {23.00 USD}
Assets:Bank:Checking -575.00 USD
Credit / Debit
- Conceptual Meaning: The two sides of every accounting entry. In simple terms, a debit increases an asset or expense account, while a credit increases a liability, equity, or income account.
- Beancount Implementation: Beancount abstracts this away. You simply use positive and negative numbers. By convention, increases to
Assets
andExpenses
are positive, while increases toLiabilities
,Equity
, andIncome
are represented by crediting them (which requires a negative number in your transaction). As long as the transaction sums to zero, the accounting is correct.
D
Directive
- Conceptual Meaning: A command or a declaration in the ledger that isn't a transaction but changes the state of the books (e.g., opening an account, recording a price).
- Beancount Implementation: Every line in a Beancount file is a directive. The main types include
open
,close
,commodity
,*
(transaction),balance
,pad
,note
,document
,price
,event
,query
, andcustom
.
Document
- Conceptual Meaning: An external file, such as a PDF statement or a receipt image, linked to a transaction or account for record-keeping.
- Beancount Implementation: The
document
directive links a file to an account. If theoption "documents"
path is set, tools like Fava can automatically discover and associate files with transactions by their date and filename. - Example:
2024-02-01 document Assets:US:BofA:Checking "statements/2024-02-01.statement.pdf"