Skip to main content

Fane

Fane 把支付宝 CSV、微信 XLSX 账单转换成 Beancount 分录,并提供导入、增量同步、分类决策应用、月度订阅生成和账本管理。统一终端入口是 fa。

先看哪篇文档

你的问题 文档
怎么安装、怎么完成一次记账、外部工具怎么调用? 使用手册
每个功能的命令、所有参数和默认值是什么? 完整命令参考
YAML、分类规则、订阅 JSON 怎么写? 配置参考
每个目录是什么、为什么分层、tools 和 j2 在哪里? 项目目录与架构

安装与开始使用

需要 Python 3.11 或更新版本;当前同步锁使用 POSIX 接口,运行环境为 macOS/Linux。在本仓库目录执行:

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

# 创建独立的本地配置,避免覆盖仓库已有的个人规则。
fa --config config/bill.local.yaml config init
fa --config config/bill.local.yaml config check
fa providers list
fa --config config/bill.local.yaml bill inspect --provider wechat --source /path/to/wechat.xlsx
fa --config config/bill.local.yaml bill convert --provider wechat --source /path/to/wechat.xlsx

也可使用 python -m fane 或 python main.py,后面的命令和参数完全相同。所有动作支持 --help,例如 fa bill import --help。全局 --config 必须放在命令组之前,也可用环境变量 FANE_CONFIG。

功能入口

fa config         init / check
fa providers      list
fa bill           convert / inspect / import / jobs / sync
fa classify       schema / extract / apply
fa subscriptions  init / check / generate
fa template       list / show / fields / check
fa ledger         validate / assertions / export / serve / publish

新命令的导入、同步、分类应用、订阅生成和余额断言默认预览,加 --write 才修改账本。config init、subscriptions init、显式输出文件会直接创建文件;ledger publish 会直接发布到远程。

tools/ 中的功能已经接入 fa classify 和 fa subscriptions,不需要下载源码里的脚本才能使用。它们可以被终端、自动化任务或外部 AI 工具通过进程调用;项目没有内置 AI 模型调用或 MCP 服务。

模板没有被删除:内置文件在 fane/infrastructure/rendering/normal.j2,随安装包分发。fa template show 可以查看,fa template show --output custom.j2 可以导出,再通过 bill convert --template custom.j2 使用。

开发验证

python -m unittest discover -s tests -v
python -m compileall -q fane ir package provider tools tests

新代码放在 fane/。根目录的 package/、provider/、ir/ 以及 tools/*.py 是历史兼容入口,详细职责见架构文档。

Metadata

Release files for Fane 1.5.0

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.5.0
File Size Uploaded
fane-1.5.0.tar.gz 86.9 kB Details

Built distribution (wheel)

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

Total release size: 193.5 kB

Release files / fane-1.5.0.tar.gz

Download URL fane-1.5.0.tar.gz
Size 86.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b01eb295fe369ec51209b5dca039965ea4cd424403b2213b0907c5c4520c6f73
BLAKE2b-256 checksum
How to use checksums
7ec0fcbd4343fa1be94b3023f1cb1e0bdaccdd5cce21f3b62839cf1956db2be1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

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

Download URL fane-1.5.0-py3-none-any.whl
Size 106.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2e9878e1d3991b51a0aac9ac9c2dfcea0b513a261e3a859613e529f6a398cc8
BLAKE2b-256 checksum
How to use checksums
972b3388e7a801925c1db33ee07bddad261ec91fd1e6fbf7466152adfc7db31f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

2.2.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

This release

1.5.0 This release

2 release files

1.4.10

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.5

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release 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