Skip to main content

Learn by Examples

Getting Started with Examples

Generate Example Data

# Basic example generation
bean-example > example.beancount

# Validate the example file
bean-check example.beancount

# Generate with specific options
bean-example --year=2024 --seed=42 > example.beancount

Convert to Other Formats

# Convert to Ledger format
bean-report example.beancount ledger > example.lgr

Report Generation

Basic Balance Reports

# All accounts
bean-report example.beancount balances

# Filter by account pattern
bean-report example.beancount balances -e ETrade

# Show cost basis
bean-report example.beancount balances -e ETrade --cost

# Format as tree
bean-report example.beancount balances | treeify

Financial Statements

# Balance Sheet
bean-report example.beancount balsheet > balsheet.html

# Income Statement
bean-report example.beancount income > income.html

Account Journals

# Basic journal
bean-report example.beancount journal \
-a Assets:US:BofA:Checking

# With running balance
bean-report example.beancount journal \
-a Assets:US:BofA:Checking --balance

# Investment account at cost
bean-report example.beancount journal \
-a Assets:US:ETrade:GLD --cost

Holdings Reports

# Detailed holdings
bean-report example.beancount holdings

# Aggregations
bean-report example.beancount holdings --by=account # By account
bean-report example.beancount holdings --by=commodity # By security
bean-report example.beancount holdings --by=currency # By currency

# Net worth
bean-report example.beancount networth

Report Formats

Output Formats

# CSV output
bean-report -f csv example.beancount holdings

# HTML output
bean-report -f html example.beancount balsheet

# Text output
bean-report -f text example.beancount journal

Statistics Reports

# List all accounts
bean-report example.beancount accounts

# Show events
bean-report example.beancount events

# Directive statistics
bean-report example.beancount stats-directives

# Posting statistics
bean-report example.beancount stats-postings

Example User Profile

Account Structure

# Banking
Assets:US:BofA:Checking # Primary checking
Liabilities:US:Chase:Slate # Credit card

# Investments
Assets:US:ETrade:Cash # Brokerage cash
Assets:US:ETrade:GLD # Gold ETF
Assets:US:Vanguard:401k # Retirement account

# Income Sources
Income:US:Employer:Salary # Regular salary
Income:US:Employer:Match # 401k match

# Regular Expenses
Expenses:Home:Rent # Monthly rent
Expenses:Food:Restaurant # Dining out
Expenses:Food:Grocery # Groceries
Expenses:Transport:Tram # Transportation

Transaction Types

  1. Regular Transactions
2024-01-15 * "Salary Payment"
Income:US:Employer:Salary -4000.00 USD
Assets:US:BofA:Checking 4000.00 USD
  1. Investment Activity
2024-01-16 * "Buy ETF"
Assets:US:ETrade:GLD 10 GLD {165.23 USD}
Assets:US:ETrade:Cash -1652.30 USD
  1. Retirement Contributions
2024-01-15 * "401k Contribution"
Assets:US:Vanguard:401k 150.00 USD
Assets:US:BofA:Checking -150.00 USD

Web Interface (Fava)

Setup

# Install Fava
pip install fava

# Run web interface
fava example.beancount

Features

  1. Account hierarchy view
  2. Balance sheet and income statements
  3. Interactive journal view
  4. Holdings reports
  5. Query interface
  6. Custom reports via plugins

This guide provides a comprehensive overview of getting started with Beancount using example data while focusing on practical usage.