Introduction to Plain Text Accounting
Introduction to plain text accounting β sirodoht blog
Revolutionary approach to personal and business accounting using simple text files:
Core Philosophy:
- Human Readable: Accounting records in plain text format
- Version Control: Track financial changes with Git
- Durability: Text files last forever, proprietary formats don’t
- Transparency: Every transaction is visible and auditable
- Scriptable: Automate analysis with standard text processing tools
Double-Entry Bookkeeping Principles:
Fundamental Equation:
Every Transaction Has Two Sides:
2021-01-13 * "Grocery shopping"
Expenses:Food:Groceries 45.67 USD
Assets:Checking -45.67 USD
Explanation:
- Money flows OUT of checking account (asset decreases)
- Money flows INTO grocery expense (expense increases)
- Total change = 0 (books balance)
Benefits of Plain Text Accounting:
Advantages Over Traditional Software:
- No Vendor Lock-in: Your data remains accessible forever
- Version Control: Complete audit trail of changes
- Automation: Scripts can generate and analyze transactions
- Customization: Unlimited flexibility in categorization
- Privacy: Data stays on your computer
- Cost: Free and open source tools
Developer-Friendly Features:
|
|
Beancount - Python-Based Accounting
beancount: Double-Entry Accounting from Text Files
Modern, powerful plain text accounting system:
Syntax and Structure:
Basic Transaction Format:
; Account declarations
1900-01-01 open Assets:US:BofA:Checking USD
1900-01-01 open Expenses:Food:Restaurant USD
1900-01-01 open Expenses:Transport:Uber USD
1900-01-01 open Income:US:Company:Salary USD
; Transactions
2021-01-13 * "Lunch at Italian restaurant"
Expenses:Food:Restaurant 28.50 USD
Assets:US:BofA:Checking -28.50 USD
2021-01-13 * "Uber ride to work"
Expenses:Transport:Uber 12.45 USD
Assets:US:BofA:Checking -12.45 USD
2021-01-15 * "Salary deposit"
Assets:US:BofA:Checking 3500.00 USD
Income:US:Company:Salary -3500.00 USD
Advanced Features:
; Price declarations
2021-01-13 price AAPL 150.00 USD
; Investment transactions
2021-01-13 * "Buy Apple stock"
Assets:US:Schwab:AAPL 10 AAPL {150.00 USD}
Assets:US:Schwab:Cash -1500.00 USD
; Multi-currency support
2021-01-13 * "European vacation expense"
Expenses:Travel:Hotel 120.00 EUR
Assets:US:BofA:Checking -142.80 USD @ 1.19 USD/EUR
; Budgets and forecasting
2021-01-01 budget Assets:US:BofA:Checking "Monthly budget: 4000 USD"
Command Line Tools:
Basic Operations:
|
|
Data Validation and Error Checking:
; Assertions to catch errors
2021-01-31 balance Assets:US:BofA:Checking 2847.55 USD
; Padding for unknown transactions
2021-01-01 pad Assets:US:BofA:Checking Equity:Opening-Balances
; Close accounts when no longer used
2021-12-31 close Assets:US:OldBank:Savings
Fava - Web Interface for Beancount
Welcome to Fava! β Fava documentation
Beautiful web interface for Beancount files:
Key Features:
Interactive Dashboard:
- Real-time Updates: Automatically reload when files change
- Charts and Graphs: Visual representation of financial data
- Drill-down Analysis: Click through from summaries to transactions
- Multi-file Support: Handle complex accounting setups
Web Interface Benefits:
|
|
Advanced Analysis:
Custom Reports:
; Custom reporting periods
2021-01-01 custom "fava-option" "fiscal-year-end" "03-31"
; Budget definitions
2021-01-01 custom "budget" Assets:US:BofA:Checking "4000 USD"
2021-01-01 custom "budget" Expenses:Food "800 USD"
Import Automation:
- Bank CSV Import: Convert bank statements to Beancount format
- Duplicate Detection: Automatic detection of duplicate transactions
- Categorization: Machine learning-based expense categorization
- Reconciliation: Match imported transactions with manual entries
Ledger - The Original Plain Text Accounting
ledger, a powerful command-line accounting system
The pioneering plain text accounting system:
Core Features:
Simple Syntax:
2021/01/13 Grocery Store
Expenses:Food:Groceries $45.67
Assets:Checking
2021/01/13 Salary
Assets:Checking $3,500.00
Income:Salary
2021/01/15 Investment
Assets:Brokerage:AAPL 10 AAPL @ $150.00
Assets:Checking $-1,500.00
Powerful Queries:
|
|
Advanced Capabilities:
Budgeting and Forecasting:
|
|
Ecosystem and Tools:
Supporting Applications:
- hledger: Haskell implementation with additional features
- PlainTextAccounting.org: Community and resources
- Mobile Apps: Various mobile entry applications
- Bank Integration: Tools for automatic transaction import
Practical Implementation:
Getting Started Workflow:
1. Set Up Account Structure:
1900-01-01 open Assets:US:BofA:Checking USD
1900-01-01 open Assets:US:BofA:Savings USD
1900-01-01 open Expenses:Food:Groceries USD
1900-01-01 open Expenses:Food:Restaurant USD
1900-01-01 open Expenses:Transport:Gas USD
1900-01-01 open Expenses:Housing:Rent USD
1900-01-01 open Income:Salary USD
2. Import Historical Data:
|
|
3. Establish Routine:
|
|
Best Practices:
- Consistent Naming: Establish and stick to account naming conventions
- Regular Reconciliation: Match against bank statements monthly
- Backup Strategy: Version control and offsite backups
- Documentation: Comment complex transactions and account purposes
- Automation: Script repetitive tasks like imports and reports
Plain text accounting represents a powerful paradigm shift in financial management, combining the rigor of double-entry bookkeeping with the flexibility and transparency of plain text files.