{"id":23346,"library":"beancount","title":"Beancount","description":"Double-entry accounting from text files. Beancount is a command-line tool and Python library that reads a plain-text ledger file and produces financial reports. Version 3.2.2, release cadence is irregular (~1-2 major releases per year). Requires Python >=3.9.","status":"active","version":"3.2.2","language":"python","source_language":"en","source_url":"https://github.com/beancount/beancount","tags":["accounting","double-entry","plain-text","finance"],"install":[{"cmd":"pip install beancount","lang":"bash","label":"pip install"}],"dependencies":[],"imports":[{"note":"load is not a top-level attribute; must import from the loader submodule.","wrong":"from beancount import load","symbol":"load","correct":"from beancount.loader import load"},{"note":"RealAccount is a data object, defined in beancount.core.data.","wrong":"from beancount.core.account import RealAccount","symbol":"RealAccount","correct":"from beancount.core.data import RealAccount"},{"note":"filter_txns is located in the realization module.","wrong":"from beancount.core import filter_txns","symbol":"filter_txns","correct":"from beancount.core.realization import filter_txns"}],"quickstart":{"code":"from beancount.loader import load\nfrom beancount.printer import format_entry\n\n# Load a ledger file (replace with actual path or use os.environ)\nimport os\nledger_path = os.environ.get('BEANCOUNT_LEDGER', 'example.bean')\nentries, errors, options_map = load(ledger_path)\nif errors:\n    for e in errors:\n        print(e)\n# Print first 5 transactions\nfor entry in entries[:5]:\n    print(format_entry(entry))","lang":"python","description":"Load a Beancount ledger file and print the first five entries."},"warnings":[{"fix":"Update Python to 3.9 or newer.","message":"Beancount 3 dropped Python 3.8 support; requires Python >=3.9.","severity":"breaking","affected_versions":"3.0+"},{"fix":"Update imports to use specific submodules (e.g., from beancount.loader import load).","message":"In Beancount 3, the old 'from beancount import *' patterns no longer work; explicit imports from submodules are required.","severity":"breaking","affected_versions":"3.0+"},{"fix":"Use spaces (2 or 4) for indentation; avoid tab characters.","message":"Beancount's ledger format is whitespace-sensitive; tabs vs. spaces can cause parse errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to using Amount and Position objects from beancount.core.amount and beancount.core.position.","message":"The 'beancount.core.inventory' API is deprecated in favor of 'beancount.core.amount' and 'beancount.core.position'.","severity":"deprecated","affected_versions":"2.3+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from beancount.loader import load'.","cause":"Importing 'from beancount import load' attempts to call the module as a function.","error":"TypeError: 'module' object is not callable"},{"fix":"Ensure the account is declared with 'open' directive before use.","cause":"Trying to access an account that hasn't been opened in the ledger.","error":"KeyError: 'open'"},{"fix":"Verify account names in the posting match exactly the declared accounts.","cause":"A transaction posting references an account that doesn't exist or is misspelled.","error":"beancount.core.data.NoMatchError: No match for posting"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}