Scripts2026年5月20日·1 分钟阅读

Beancount — Plain-Text Double-Entry Bookkeeping

A Python-based double-entry bookkeeping system that uses plain-text files as the data source, with a focus on correctness, auditability, and extensibility through plugins.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Beancount Bookkeeping
通用 CLI 安装命令
npx tokrepo install 13e62947-5426-11f1-9bc6-00163e2b0d79

Introduction

Beancount is a double-entry bookkeeping system where financial data lives in plain-text files. Written in Python, it emphasizes correctness through strict validation and offers Fava, a companion web interface, for interactive exploration of financial reports.

What Beancount Does

  • Validates and processes plain-text ledger files with strict double-entry enforcement
  • Generates income statements, balance sheets, and trial balances from transaction data
  • Tracks multiple currencies, commodities, and investment lots with cost basis
  • Provides Fava, a web-based dashboard for browsing accounts, charts, and reports
  • Supports extensibility through Python plugins for custom validation and transformation

Architecture Overview

Beancount parses a ledger file into an in-memory stream of directives (transactions, balance assertions, open/close events). A processing pipeline applies plugins that validate, transform, or augment the directive stream. The output is consumed by reporting tools like bean-report or the Fava web server, which renders interactive dashboards using Flask.

Self-Hosting & Configuration

  • Install Beancount and Fava via pip in a Python virtual environment
  • Store ledger files in a Git repository for version-controlled audit trails
  • Configure operating currency and account hierarchies with option directives
  • Write Python plugins to automate recurring entries or enforce custom rules
  • Run Fava locally or on a server for shared access to financial dashboards

Key Features

  • Strict validation that catches unbalanced transactions and account errors at parse time
  • Fava web interface with interactive charts, account drill-down, and query language
  • Python plugin system for custom importers, transformations, and validation rules
  • Multi-currency support with automatic cost tracking and unrealized gains reporting
  • Deterministic processing: same input always produces the same output

Comparison with Similar Tools

  • Ledger — C++ original with faster parsing; Beancount has stricter validation and Fava web UI
  • hledger — Haskell-based with its own web UI; Beancount offers Python extensibility
  • GnuCash — GUI desktop app; Beancount is text-first with version control integration
  • Firefly III — Web-based personal finance; Beancount is developer-oriented with plain-text storage

FAQ

Q: What is Fava? A: Fava is a web frontend for Beancount that visualizes accounts, balances, and reports in a browser.

Q: Can I import bank statements? A: Yes, Beancount has an importer framework and community tools for converting CSV/OFX to Beancount format.

Q: Is Beancount suitable for business accounting? A: Yes, it handles multi-currency, invoicing workflows, and tax reporting for small businesses.

Q: How does Beancount differ from Ledger? A: Beancount requires accounts to be explicitly opened, enforces stricter balancing rules, and uses Python instead of C++.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产