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;测试在它存在时执行额外冒烟验证,不存在时 自动跳过,版本化单元测试仍会正常运行。

Metadata

Release files for Fane 1.4.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Fane 1.4.9
File Size Uploaded Provenance Actions
fane-1.4.9.tar.gz 40.8 kB Without provenance Details for fane-1.4.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Fane 1.4.9
File Interpreter ABI Platform Actions
fane-1.4.9-py3-none-any.whl Python 3 none any Details for fane-1.4.9-py3-none-any.whl

Total release size: 88.2 kB

Release files / fane-1.4.9.tar.gz

Download URL fane-1.4.9.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5862fb5cbc2428164cfaa7c27d28933ea34cf8432d1ad0d42526de5fa4082ed5
BLAKE2b-256 checksum
How to use checksums
7de69d0fc7b709cf36d745ec13d197314424f3bf0500d0d74688606280c6dbb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / fane-1.4.9-py3-none-any.whl

Download URL fane-1.4.9-py3-none-any.whl
Size 47.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fc0d826d26f3f5f4a6e6fd3e0093c18bea4559324fa545861319beef07823dd
BLAKE2b-256 checksum
How to use checksums
fb4d1ab113d21e12fa9d370c76fb72827a259801001e4204590f8876ad4264dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for Fane 1.4.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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