Overview of Fava
mainBeancount double-entry bookkeeping software. It focuses on usability and providing a feature-rich interface for managing Beancount ledgers.repository·main·Indexed 25 days ago
https://github.com/beancount/favaA web interface for the Beancount accounting tool that provides a visual way to interact with financial data. Documentation covers installation via pip, development environment setup, and various deployment strategies including Docker, systemd, PythonAnywhere, and Apache reverse proxies with OAuth2 Proxy and Let's Encrypt SSL.
Beancount double-entry bookkeeping software. It focuses on usability and providing a feature-rich interface for managing Beancount ledgers.Fava extensions are composed of three main capabilities:
report_title attribute, Fava will treat it as a report page. The HTML template must be located in a templates subdirectory named after the class (e.g., fava/ext/MyExtension/templates/MyExtension.html).has_js_module = True, Fava will load a JavaScript file matching the class name (e.g., MyExtension.js).JavaScript Lifecycle Events:
init: Called when a Fava report is first opened.onPageLoad: Called when any page in Fava is loaded (initial open and subsequent navigation).onExtensionPageLoad: Called specifically when the extension's report is loaded.Fava displays colored indicators next to accounts to help track if they are up-to-date. These appear if the account's Open directive has the metadata fava-uptodate-indication: TRUE set.
Indicator Colors:
uptodate-indicator-grey-lookback-days option.Accounts in Beancount are defined using a colon-separated list of capitalized words (e.g., Assets:Cash). This creates an implicit hierarchy where Assets:Cash is a sub-account of Assets.
By default, all accounts must begin with one of the five root accounts:
| Name | Type | Contains |
|---|---|---|
Assets | + | Cash, Checking-Account, etc. |
Liabilities | - | Credit Card, etc. |
Income | - | Salary, etc. |
Expenses | + | Expense categories |
Equity | - | Almost always auto-generated |
Note: + indicates an increase in balance, - indicates a decrease.
Fava provides several modes for converting inventory positions in reports:
10 STOCK {4 USD} is converted to 40 USD.10 STOCK {4 USD} is converted to 50 USD if the current price of STOCK is 5 USD.10 STOCK).X. If no direct price for the asset in X exists, Fava attempts a conversion via the cost currency (e.g., if STOCK is priced in USD and X is also priced in USD).STOCK $\rightarrow$ X $\rightarrow$ Y).Note on failed conversions: Fava will not silently drop amounts. If a conversion is impossible, the original un-converted units will be displayed.
When a time filter is applied, Fava uses Beancount's "clamp" summarisation to ensure reports reflect the state within that specific interval:
account_previous_earnings (retained earnings) account. These accounts effectively start with a zero balance in the report.account_previous_balances (opening balances) account, allowing these accounts to show their accumulated balance.account_current_conversions account to account for changes occurring within the filtered period.To see the original source text (such as a CSV row or XML fragment) for an entry in the Fava import list, set the special metadata key __source__ on the entry.
Note: Fava will strip this metadata key (and all other keys starting with an underscore _) before saving the entry to your Beancount file.
Use the metadata filter to target specific entry attributes. Filters are case-insensitive and support Python-style regular expressions.
#tag or ^link.= 100.20 or >= 100.attribute:"value".payee:"restaurant"narration:'Dinner with Joe'payee and narration. For Note directives, it searches the comment.key:"value" (e.g., document:"\.pdf$"). If an entry has a standard attribute with the same name as the metadata key, the filter applies to the attribute instead.#tag payee:"Joe").#tag,payee:"Joe").- to exclude matches (e.g., -#tag or -(^link #tag)).(filter1 or filter2) and filter3).Fava's frontend is built using JavaScript. If you modify frontend code, you must rebuild it.
make to rebuild the frontend.make watch to automatically rerun the build whenever files change.To customize Fava's behavior, add custom "fava-option" entries directly to your Beancount file. Each option follows the format: YYYY-MM-DD custom "fava-option" "option-name" "value".
2016-06-14 custom "fava-option" "default-file"
2016-04-14 custom "fava-option" "auto-reload" "true"
2016-04-14 custom "fava-option" "currency-column" "100"To secure your deployment with automated SSL, run three containers that work together using the --volumes-from flag to share Nginx configuration and certificate paths. This setup requires exposing ports 80 and 443 on your host.
Note: These containers require access to the Docker socket (/var/run/docker.sock) to monitor other containers and trigger configuration updates.
# 1. Run Nginx
docker run --detach --publish 80:80 --publish 443:443 \
--name nginx \
--volume /etc/nginx/conf.d \
--volume /etc/nginx/vhost.d \
--volume /usr/share/nginx/html \
--volume $(pwd)/certs:/etc/nginx/certs:ro \
--volume $(pwd)/htpasswd:/etc/nginx/htpasswd:ro \
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true \
nginx
# 2. Run Nginx-Gen
docker run --detach \
--name nginx-gen \
--volumes-from nginx \
--volume /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/docker-gen \
-notify-sighup nginx -watch -only-exposed -wait 5s:30s \
/etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
# 3. Run Nginx-Letsencrypt
docker run --detach \
--name nginx-letsencrypt \
--env "NGINX_DOCKER_GEN_CONTAINER=nginx-gen" \
--volumes-from nginx \
--volume $(dirname $(realpath $0))/certs:/etc/nginx/certs:rw \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
jrcs/letsencrypt-nginx-proxy-companionUse the time filter input to display entries within specific periods. Fava supports absolute dates, intervals, and relative date math.
20152012-Q12010-102016-W122015-06-122010 - 2012-10 (displays entries from the start of 2010 to the end of October 2012).You can use year, quarter, month, week, and day to refer to the current date. These support addition and subtraction.
year - day: All entries in the current year up to today.year-1 - year: All entries from the last year and the current year.Note on Parentheses: Use parentheses to prevent subtraction from the variable itself.
(month)-10 refers to the 10th of the current month.month-10 refers to 10 months ago.