Skip to main content

Fava Account Maintenance

Fava Account Maintenance is a read-only Fava extension for understanding a large Beancount chart of accounts. It combines an account tree with operational views for balance freshness, dormant or unused accounts, account lifecycle, historical boundaries, Pad usage, and temporary buffer accounts.

The report UI is currently written in Traditional Chinese. The source and the example ledger contain only synthetic account names and amounts.

What it shows

  • A collapsible tree built from the ledger's Assets, Liabilities, and Equity roots.
  • A default Balance 更新 queue: never-balanced accounts first, then partial multi-commodity balances, overdue accounts, and accounts nearest their due date.
  • Open, closed, future, unused, dormant-zero, and dormant-nonzero accounts.
  • Whether an account explicitly started at zero, was seeded from Equity, or began with Pad.
  • Late or repeated Pad directives that may indicate a historical gap.
  • Configurable investment, buffer, and Equity-role conventions.

The extension does not edit the ledger and does not make network requests.

Compatibility

Version 0.1.1 is tested with Fava 1.30.12, Beancount 3.2, and Python 3.12. The dependency is intentionally limited to Fava 1.30.x until newer versions are tested. Fava describes its extension API as unstable, so test upgrades before deploying them to a production ledger.

Install

Install the package into the same Python environment that runs Fava:

python -m pip install fava-account-maintenance

If Fava was installed with pipx, inject the extension into that environment:

pipx inject fava fava-account-maintenance

To install a tagged GitHub version directly:

python -m pip install \
  "git+https://github.com/hsiuhsiu/fava-account-maintenance.git@v0.1.1"

For a local checkout:

python -m pip install ./fava-account-maintenance

Then enable the extension in the main Beancount file:

2000-01-01 custom "fava-extension" "fava_account_maintenance"

Fava also searches the directory containing the main Beancount file. For a drop-in installation, copy the complete fava_account_maintenance package directory next to that file; keep UpdateGuidance.js and the templates directory inside the package.

Docker

The extension and ledger can remain in separate repositories. Mount the source directory read-only and add it to PYTHONPATH:

services:
  fava:
    volumes:
      - ./ledger:/ledger
      - ./fava-account-maintenance/src:/extensions:ro
    environment:
      PYTHONPATH: /extensions

Recreate the container after changing the extension version. A production image can instead install a tagged release during its build.

Ledger metadata

Balance freshness is opt-in per account. The value is a number of days:

2020-01-01 open Assets:Household:Checking:Example USD
  balance_frequency: 30
  nickname: "Daily checking"
  purpose: "Household cash flow"

Supported open metadata:

Key Meaning
balance_frequency Expected number of days between Balance assertions.
nickname Short label displayed beside the full account name.
purpose Reminder of why the account exists.
maintenance_kind Overrides the account-kind component for this account.
maintenance_buffer TRUE or FALSE override for buffer detection.
maintenance_role Equity role override; see the configuration section.

For example:

2020-01-01 open Equity:Opening-Balances
  maintenance_role: "opening_history"

2020-01-01 open Assets:Household:Clearing:Transfers USD
  maintenance_buffer: TRUE

Extension configuration

Configuration is optional. Fava passes the last string in the custom directive as a Python-literal mapping:

2000-01-01 custom "fava-extension" "fava_account_maintenance" "{'dormant_days': 180, 'buffer_components': ['Buffer', 'Clearing'], 'equity_roles': {'Equity:Opening-Balances': 'opening_history'}, 'source_mode': 'basename'}"
Option Default Meaning
dormant_days 365 Inactivity threshold for dormant accounts.
kind_component_index 2 Zero-based account component used as kind; Assets is component 0.
investment_kinds common investment labels Kinds whose commodity balances and prices are checked individually.
buffer_components ['Buffer'] Exact account components treated as temporary buffers.
equity_roles {} Account-prefix to Equity-role mapping. Longest prefix wins.
source_mode 'basename' Source display: 'hidden', 'basename', or 'relative'.
source_root unset Root removed from source paths in 'relative' mode.

Allowed Equity roles are technical, modeled_asset, opening_history, untraceable, dust, revaluation, buffer, and other.

The default kind index works for both Assets:Bank:Checking and Assets:Owner:Checking:Bank. Use maintenance_kind when a particular account does not follow the general convention.

Privacy and deployment boundary

The repository does not need, include, or transmit a ledger. At runtime, however, the report necessarily sends its derived model to the browser. That model includes account names, native-currency inventories, lifecycle and activity dates, Pad sources, counterpart accounts, and—unless hidden—source basenames and line numbers.

Therefore:

  • Protect the Fava instance with the same care as the ledger.
  • Do not publish a saved report page, browser archive, screenshot, cache, or application log made from a real ledger.
  • Do not expose the Fava server directly to the public internet.
  • Use {'source_mode': 'hidden'} if source locations are not useful.

The source-path formatter never returns an absolute path. In relative mode, paths outside source_root fall back to their basename. These settings control this extension's model only; Fava itself may expose ledger filenames in its standard page data, which is another reason the Fava instance must remain private.

Development

python -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
ruff check .
pytest
python -m build

The wheel must contain both UpdateGuidance.js and templates/UpdateGuidance.html; Fava loads those files directly without a Node build step.

License

MIT

Metadata

Release files for fava-account-maintenance 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fava-account-maintenance 0.1.1
File Size Uploaded
fava_account_maintenance-0.1.1.tar.gz 29.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fava-account-maintenance 0.1.1
File Interpreter ABI Platform
fava_account_maintenance-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 53.4 kB

Release files / fava_account_maintenance-0.1.1.tar.gz

Download URL fava_account_maintenance-0.1.1.tar.gz
Size 29.8 kB
Tags Source
SHA-256 checksum
How to use checksums
01f979fe9d3f491303836c422fcf8a2ec7d49b91f5fd261ff73826aadcf80378
BLAKE2b-256 checksum
How to use checksums
39e955f199537ab5f9b3264066f4abf3b7ca2d716d700d3cad4f2a1d0f7aca6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / fava_account_maintenance-0.1.1-py3-none-any.whl

Download URL fava_account_maintenance-0.1.1-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85aad6245404f50fd775680b39a3b12d5d54580161e0317acfd6228355c777b0
BLAKE2b-256 checksum
How to use checksums
a7abd5cffdd72e5f9f557eab0ff13770581e8153bbd7a712fbcadd9b9189a8f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page