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.10.tar.gz (41.3 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.10-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fane-1.4.10.tar.gz
  • Upload date:
  • Size: 41.3 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.10.tar.gz
Algorithm Hash digest
SHA256 04ce72413279b444e9c8e79d6d88e2aed644e04b28e04c9930aa6aa138bb8856
MD5 6ba1b74258040db69f671c57928c4706
BLAKE2b-256 8b384d37f712e1e8a3745aced8c847e774737a0a07cf994a1e54fe7961f6b506

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fane-1.4.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 2fef431faf6cae1d7548779801cdaba8ab16a351aa95a22025616fd076943f61
MD5 0c6066d7ff3984bba97f313f99dfc2ad
BLAKE2b-256 2a3274736b69c1d960cfe5b568f103bf641b444576aff9c2f11baba1e90c1f68

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.10 This release

2 files

1.4.9

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