Skip to main content

Fane

Fane 是一个本地运行的账单转换器:读取支付宝 CSV、微信 XLSX,按照 YAML 规则映射 Beancount 账户,并输出或直接写入月度账本。

它不会替代 Beancount,也不会联网同步账单。它解决的是“第三方账单到规范分录” 这一步。

兼容性

现有命令和默认行为保持不变:

fa --config ~/.flow/config.yaml trans --provider alipay --source bill.csv
fa --config ~/.flow/config.yaml import --provider wechat --source bill.xlsx \
  --journal-dir ~/.flow/account/journal
  • trans 默认仍输出原有的按支出/收入和月份分组的 JSON。
  • import 默认仍将支出写入 YEAR/YEAR-MM.bean,收入写入 YEAR/income.bean
  • 默认配置仍是 ~/.flow/config.yaml
  • 原有 YAML 字段继续接受;doctor 只报告兼容性警告,不会修改配置。

安装

在源码目录创建虚拟环境并安装:

python3 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/fa --version

也可以继续直接运行源码入口:

.venv/bin/python main.py --help

五分钟开始

创建最小配置:

fa init
fa doctor

只读检查账单,不写文件:

fa inspect --provider alipay --source bill.csv

预览 Beancount:

fa trans --provider alipay --source bill.csv --format beancount

先 dry-run,再正式导入:

fa import --provider alipay --source bill.csv \
  --journal-dir ~/.flow/account/journal --dry-run

fa import --provider alipay --source bill.csv \
  --journal-dir ~/.flow/account/journal --summary --require-classified

已经有每日账单脚本时,可在配置中增加 jobs,让 Fane 自己完成多来源增量导入:

fa --config ~/.flow/bill.yaml sync daily --dry-run
fa --config ~/.flow/bill.yaml sync daily

sync 提供文件变化检测、交易指纹去重、按交易日期路由、并发锁、失败回滚和账本校验; 完整配置及从现有 Bash 脚本迁移的方法见功能使用手册第 9 节。

完整命令、规则字段、输出格式、去重与兼容说明见 功能使用手册。项目内部架构见 项目导览

验证

.venv/bin/python -m unittest discover -s tests -v
.venv/bin/python -m compileall -q ir package provider tests

example/ 是本地账单目录,不进入 Git;测试在它存在时执行额外冒烟验证,不存在时 自动跳过,版本化单元测试仍会正常运行。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fane-1.4.9.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fane-1.4.9-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

Details for the file fane-1.4.9.tar.gz.

File metadata

  • Download URL: fane-1.4.9.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for fane-1.4.9.tar.gz
Algorithm Hash digest
SHA256 5862fb5cbc2428164cfaa7c27d28933ea34cf8432d1ad0d42526de5fa4082ed5
MD5 1c78557a8c226d77fdd7658404633c36
BLAKE2b-256 7de69d0fc7b709cf36d745ec13d197314424f3bf0500d0d74688606280c6dbb1

See more details on using hashes here.

File details

Details for the file fane-1.4.9-py3-none-any.whl.

File metadata

  • Download URL: fane-1.4.9-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for fane-1.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5fc0d826d26f3f5f4a6e6fd3e0093c18bea4559324fa545861319beef07823dd
MD5 b0ce538decbed2f92cd821d9de3e2776
BLAKE2b-256 fb4d1ab113d21e12fa9d370c76fb72827a259801001e4204590f8876ad4264dd

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4.10

2 files

This release

1.4.9 This release

2 files

1.4.8

2 files

1.4.7

2 files

1.4.5

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page