Accounting Dictionary for Beancount Users (A–Z)
· 17 хвилин читання
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"
Double-Entry
- Conceptual Meaning: The accounting principle that every transaction must affect at least two accounts and must balance (total debits must equal total credits).
- Beancount Implementation: This is the core, non-negotiable principle of Beancount. The zero-sum rule for all transaction postings ensures double-entry bookkeeping is always maintained.
E
Equity
- Conceptual Meaning: The net worth or owner's stake in the assets (Assets - Liabilities). This includes initial capital contributions and accumulated profits/losses (retained earnings).
- Beancount Implementation: Beancount uses
Equity
accounts for several internal functions, such asEquity:Opening-Balances
to initialize account values andEquity:Earnings:Current
to accumulate income and expense totals for reporting.
Event
- Conceptual Meaning: A dated, non-financial marker on your timeline, useful for annotating life events like a job change, a move, or a vacation.
- Beancount Implementation: The
event
directive allows you to add a key-value pair to a specific date in your ledger. - Example:
2024-08-15 event "location" "Moved to San Francisco"
Exchange Rate
- Conceptual Meaning: The value of one currency expressed in terms of another.
- Beancount Implementation: Exchange rates can be recorded with
price
directives for a specific date or specified directly within a transaction using inline prices (@
or@@
).
F
Fava
- Conceptual Meaning: The modern, feature-rich web interface for Beancount.
- Beancount Implementation: Fava is a separate Python package you install and run against your Beancount file. It provides interactive charts, reports (Balance Sheet, Income Statement), budgeting tools, query execution, and a file editor, replacing most of the older
bean-web
andbean-report
command-line tools.
FIFO / LIFO
- Conceptual Meaning: Acronyms for "First-In, First-Out" and "Last-In, First-Out," which are two common booking methods for matching inventory sales.
- Beancount Implementation: These can be selected as the
booking_method
for an account or globally. (See Booking Method).
Flag
- Conceptual Meaning: A status indicator on a transaction.
- Beancount Implementation: A transaction's flag appears after the date.
*
typically means "cleared" or "confirmed," while!
means "incomplete" or "needs review." Custom flags are also possible.
G
General Ledger / Journal
- Conceptual Meaning: A journal is a chronological record of all transactions. A ledger is a record of those same transactions, but sorted by account.
- Beancount Implementation: Your
.beancount
text files collectively form the journal. Tools like Fava orbean-query
process this journal to generate ledgers (e.g., the transaction list for a single account) and other reports.
I
Include
- Conceptual Meaning: The practice of splitting a large ledger into multiple, more manageable files (e.g., by year or account type).
- Beancount Implementation: The
include
directive tells Beancount to parse the contents of another file as if it were part of the main file. - Example:
include "2024/transactions.beancount"
include "accounts/open_accounts.beancount"
Inventory
- Conceptual Meaning: The collection of all lots (units with a specific cost basis) held within an account at any given time.
- Beancount Implementation: This is a core Beancount concept. Each account that holds non-currency commodities maintains an inventory of lots. When you sell or transfer units, Beancount reduces the inventory according to the booking method.
Inline Price vs. Total Price
- Conceptual Meaning: Two ways to specify the conversion price within a transaction posting. You can either price it per unit or define the total price for the entire posting.
- Beancount Implementation:
@
sets a per-unit price.@@
sets a total price for the line.
- Example (per-unit):
2025-01-05 * "FX Transfer"
Assets:USD -100.00 USD @ 1.34 CAD
Assets:CAD
L
Link
- Conceptual Meaning: A unique identifier used to connect multiple, separate transactions that are part of a single logical event (e.g., a credit card payment and the corresponding bank withdrawal).
- Beancount Implementation: Add a
^link_id
to each transaction you want to group. Fava and other tools can then display these linked transactions together. - Example:
^cc-payment-2025-01
Lot
- Conceptual Meaning: A specific quantity of a commodity purchased at a particular date and cost.
- Beancount Implementation: A lot is defined by its amount, commodity, cost, date, and an optional label. Lots are created using the
{...}
cost basis syntax and are tracked in an account's inventory.