了解beancount并折腾beancount+emacs

了解beancount并折腾beancount+emacs

termux安装beancount和fava

1
2
3
4
5
# 安装相关依赖
pkg install -y cmake automake autoconf libtool beancount-periodic

# 安装对应的包
pip install beancount fava

emacs配置

1
2
3
(use-package beancount
  :ensure t
  :mode ("\\.bea\\(n\\|ncount\\)\\'" . beancount-mode))

emacs安装beancount包,支持.bean和.beancount文件

快速上手

首先需要安装 Python3 环境,然后安装对应的包

1
2
3
4
pip install beancount fava

# 如果安装beancount包没有bean-price,可以单独安装beanprice这个包
pip install beanprice

注:在Git Bash中操作

如果是在Git Bash中,安装完对应包后要检测是否有对应包,并将其所在路径添加环境变量

1
2
ls /c/Users/$USERNAME/AppData/Roaming/Python/Python37/Scripts | grep bean
export PATH=$PATH:/c/Users/$USERNAME/AppData/Roaming/Python/Python37/Scripts # 把 Scripts 目录加到 PATH,如果要长期生效,把上面那一行加到 ~/.bashrc 或 ~/.bash_profile。

生成一个官方提供的示例

1
bean-example > example.beancount

通过 fava 命令运行 WebUI

1
fava -H 0.0.0.0 example.beancount

默认情况下Web UI会运行在 http://localhost:5000 ,不过我最终还是指定了实际IP,方便局域网访问

Licensed under CC BY-NC-SA 4.0
最后更新于 Aug 18, 2025 02:38 +0800
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计