feat: 支持 ETF 份额分拆 (split) 份额分拆被错误处理为卖出(移除旧份额但不补新份额)。 现在检测 txType 含”分拆”时生成正确分录: 移除旧份额 {} (inventory 匹配原始 lot) 添加新份额 {调整后成本} (从 netPnl/position 计算) 无现金流, 无 PnL
feat: 支持 ETF 份额分拆 (split)
份额分拆被错误处理为卖出(移除旧份额但不补新份额)。 现在检测 txType 含”分拆”时生成正确分录:
把银行账单、第三方支付、券商交易记录转成 Beancount 复式分录的 CLI 工具。
第三方支付 alipay wechat jd mt 银行 icbc ccb dzccb 证券 yinhe futu
从 Releases 下载对应平台的二进制,解压即用。
./beancount-importer-rust --help
从源码编译:
cargo build --release
Step 1 — 导出账单(支付宝 → 支付宝 → 账单 → ··· → 开具交易流水证明)
Step 2 — 一条命令:
./beancount-importer-rust \ -p alipay \ -s ~/Downloads/alipay_2026.csv \ -c config/third_party/alipay.yml \ -o alipay.bean --log-level info
输出类似:
2026-06-15 * "星巴克" "Coffee" source: "支付宝" orderId: "20260615..." Expenses:Food:Coffee 32.50 CNY Assets:Wallet:Alipay:Balance -32.50 CNY
Step 3 — 配置规则自动分类。在 config/third_party/alipay.yml 加:
config/third_party/alipay.yml
rules: - name: "餐饮" conditions: - fields: [peer, item] regex: "星巴克|麦当劳|外卖" action: debit_account: "Expenses:Food" - name: "交通" conditions: - field: "peer" contains: "滴滴|铁路|地铁" action: debit_account: "Expenses:Transport"
功能清单与完整示例见 QUICKSTART.md
配置写好后每月只需要一条命令:
# batch-2026-06.yml imports: - provider: icbc source: ~/Downloads/icbc-202606.csv config: config/banks/icbc.yml output: 2026/06/icbc.bean - provider: alipay source: ~/Downloads/alipay-202606.csv config: config/third_party/alipay.yml output: 2026/06/alipay.bean
./beancount-importer-rust --batch batch-2026-06.yml
-p, --provider
alipay|wechat|icbc|yinhe|...
-s, --source
-c, --config
-g, --global-config
config/global.yml
-m, --mapping
-o, --output
--log-level
error|warn|info|debug|trace
--strict
-b, --batch
MIT
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
beancount-importer-rust
把银行账单、第三方支付、券商交易记录转成 Beancount 复式分录的 CLI 工具。
支持的供应商
安装
从 Releases 下载对应平台的二进制,解压即用。
从源码编译:
5 分钟上手
Step 1 — 导出账单(支付宝 → 支付宝 → 账单 → ··· → 开具交易流水证明)
Step 2 — 一条命令:
输出类似:
Step 3 — 配置规则自动分类。在
config/third_party/alipay.yml加:每月一键导入(批量模式)
配置写好后每月只需要一条命令:
账单导出位置
CLI
-p, --provideralipay|wechat|icbc|yinhe|...)-s, --source-c, --config-g, --global-configconfig/global.yml)-m, --mapping-o, --output--log-levelerror|warn|info|debug|trace--strict-b, --batch文档
License
MIT