Beancount的文档验证插件
beancount-docverif的Python项目详细描述
Beancount Docverif
Docverif是beancount的“文档验证”插件, 履行以下职能:
- 在
要求每一笔涉及账户的交易都必须有 磁盘上的文档:
2000-01-01 open Expenses:General BEAN docverif: "Require"
在 - 在
明确声明交易所附文件的名称:
^{pr2}$ 在 - 在
显式声明事务不应具有 随附文件:
; Explicit "None" document: should ignore missing document 2020-06-01 * "store" "groceries" document: "None" Expenses:General Assets:Bank -10 BEAN
在 - 在
查找与事务数据匹配的“隐式”PDF文档:
; Document entry without an explicit "document" entry, ; should implicitly match document: "2020-06-01.plumber - services.pdf" 2020-06-01 * "plumber" "services" Expenses:General Assets:Bank -150 BEAN
在 - 在
将文件与任何类型的条目相关联(并要求), 包括
open
项本身:2000-01-01 open Assets:Bank BEAN docverif: "Require" document: "2020-06-01.plumber - services.pdf"
在 - 在
保证完整性:验证声明的每个文档 确实存在于磁盘上。在
在
安装
pipinstallbeancount_docverif
使用
{top2>包含在cd2}中:
plugin "beancount_docverif" option "documents" "./"
有关示例,请参见test中的.beancount
文件。在
发展中
本地安装包和开发人员要求:
python3 -m pip install -e .[dev]
运行测试:
python3 -m pytest
在本地构建二进制和源发行版:
python3 setup.py bdist_wheel sdist
有关维护人员的个人工具,请参见sanitize.sh。在
Beancount怪癖
- 在
我们依靠beancount自己查找文件 以及自动生成
Document
项。 这需要在beancount文件本身中有一个documents
选项,例如:option "documents" "./"
在 - 在
子目录格式TODO
在 - 在
虚构的TODO
在 - 在
文件名必须有效(例如“断开.pdf“已退出)
在
- 项目
标签: