本文件用于将每月的账单从notion保存到beancount.
和网上分享的多层文件一致,每月账单的路径为YYYY/M.bean
, Expenses:XXX
存储于accounts/expenses.bean
,对应了生成月账单的支出类型.
#expense.bean
option "title" "expenses"
option "operating_currency" "CNY"
; 2001-08-06 open Expenses:Unknown CNY
2001-08-06 open Expenses:Other CNY
2001-08-06 open Expenses:Dining CNY
2001-08-06 open Expenses:Shopping CNY
2001-08-06 open Expenses:Transportation CNY
2001-08-06 open Expenses:Entertainment CNY
2001-08-06 open Expenses:Electronics CNY
2001-08-06 open Expenses:Clothing CNY
2001-08-06 open Expenses:Pets CNY
2001-08-06 open Expenses:Daily CNY
2001-08-06 open Expenses:SnacksandBeverages CNY
2001-08-06 open Expenses:FruitsandVegetables CNY
每月记账完成后进入月账单的database
,点击右上角...=>Export
,选项Markdown&CSV/Everything/Everyting
,解压导出的zip,将其放在和import.py
同路径下运行以下命令.
python import.py
PS:因为我的记录方法为每月统计一次,因此生成的bean文件以database内第一笔账的月份为名.