メインコンテンツへスキップ
Beancount.io Logo

チートシート

Beancountの包括的なチートシート。勘定科目構造、取引構文、コマンド、およびプレーンテキスト会計と財務記録のための実践的な例を網羅。

勘定科目構造

勘定科目タイプと符号

Type          Sign    Example
------------------------------------------------
Assets        (+)     Assets:US:BofA:Checking
Liabilities   (-)     Liabilities:Credit:Amex
Income        (-)     Income:Salary:Gross
Expenses      (+)     Expenses:Food:Restaurant
Equity        (-)     Equity:Opening-Balances

通貨形式

通貨は大文字のシンボル — 通貨コード、ティッカー、カスタム単位 — です。これらは命名規則であり、指示ではありません:

Currencies:       USD, EUR, CAD, AUD
Investments:      GOOG, AAPL, VTI
Cryptocurrencies: BTC, ETH
Custom units:     HOURS, AIRMILES, HOME_MAYST

ディレクティブ構文

勘定科目管理

; Opening accounts
2024-01-01 open Assets:Checking             ; Simple
2024-01-01 open Assets:Investing USD,GOOG   ; With constraints
 
; Closing accounts
2024-12-31 close Assets:Old:Account

コモディティ宣言

2024-01-01 commodity VTSAX
    name: "Vanguard Total Stock Market Index"
    asset-class: "equity"

取引記録

; Basic transaction
2024-01-15 * "Grocery Store" "Weekly shopping"
    Assets:Checking     -100.00 USD
    Expenses:Food:Groceries
 
; With metadata and tags (#work is a tag, ^invoice-123 is a link)
2024-01-15 * "Restaurant" "Business dinner" #work ^invoice-123
    id: "T-1234"
    receipt: "path/to/receipt.pdf"
    Expenses:Meals      80.00 USD
    Liabilities:Credit

ポスティング仕様

これらはポスティング行 — 各取引の内側にあり、その日付行の下にインデントされます:

; Basic amount
Assets:Cash              100.00 USD
 
; Cost basis tracking
Assets:Invest:VTSAX      10 VTSAX {100.00 USD}        ; Per-unit cost
Assets:Invest:VTSAX      10 VTSAX {{1000.00 USD}}     ; Total cost
Assets:Invest:VTSAX      10 VTSAX {100.00 # 9.95 USD} ; Per-unit plus total fee
 
; Price specifications
Assets:Forex            1000.00 USD @ 0.85 EUR        ; Per-unit
Assets:Forex            1000.00 USD @@ 850.00 EUR     ; Total price
 
; Dated lots
Assets:Invest:VTSAX      10 VTSAX {100.00 USD, 2024-01-15}

残高検証

; Balance padding: fills Assets:Checking up to Equity:Opening-Balances
2024-01-01 pad Assets:Checking Equity:Opening-Balances
 
; Balance assertion: checked at the start of its date, so date it after the pad
2024-02-01 balance Assets:Checking  1000.00 USD

メタデータ追跡

; Note attachment
2024-01-15 note Assets:Checking "Called bank about fee"
 
; Document linking
2024-01-15 document Assets:Checking "path/to/statement.pdf"
 
; Price recording
2024-01-15 price VTSAX  100.00 USD

イベント記録

; Location tracking
2024-01-15 event "location" "New York, USA"
 
; Property changes
2024-01-15 event "address" "123 Main Street"

タグ管理

; Tag scope control: #vacation applies to every transaction between the pushtag and poptag
pushtag #vacation
2024-01-15 * "Hotel"
    Expenses:Travel:Lodging   200.00 USD
    Assets:Credit
poptag #vacation

設定オプション

; Basic settings
option "title" "Personal Finance Ledger"
option "operating_currency" "USD"
 
; Account naming
option "name_assets" "Assets"
option "name_liabilities" "Liabilities"
option "name_income" "Income"
option "name_expenses" "Expenses"
option "name_equity" "Equity"
 
; Document handling
option "documents" "/path/to/docs"

コメントと整理

; Single line comment
 
* Section Header
** Subsection
; Transaction block follows...
 
; Account grouping
; Assets
2024-01-15 ...
 
; Expenses
2024-01-16 ...

このリファレンスは、Beancount構文要素の完全な概要を、実践的な例とともに提供します。

出典: https://beancount.io/ja/docs/Basics/cheatsheet