Skip to main content

beancount-daoru

PyPI - Version Ask DeepWiki

一个专为中文用户设计的 Beancount 账单导入工具,让复式记账更高效。

项目仍在开发中,API 可能会发生变化,欢迎反馈或建议。

功能

亮点:

  • 多源账单覆盖:支持主流支付平台,以及部分银行账单

  • 原生格式解析:直接导入 PDF/CSV/XLSX 原始账单,无需手动转换

  • LLM 智能分类:集成大语言模型自动预测交易分类

  • 官方生态兼容:适配 Beangulp导入流程, 支持 Fava 可视化导入

  • 灵活账户映射:支持多账户区分,自定义币种配置

当前支持的账单源:

源 导出方式 格式
支付宝 APP导出,全部勾选,发送到邮箱 csv
微信 APP导出,全部勾选,发送到邮箱 xlsx
京东 APP导出,全部勾选,发送到邮箱 csv
美团 APP导出,全部勾选,发送到邮箱 csv
拼多多 网页端导出,使用第三方导出工具 csv
中国银行 APP导出,全部勾选,APP内下载 pdf
交通银行 APP导出,全部勾选,发送到邮箱 pdf
建设银行 APP导出,全部勾选,发送到邮箱 xls

使用

安装

pip install beancount-daoru

如果需要使用 LLM 功能,需要安装额外依赖:

pip install beancount-daoru[llm]

简单用例

最简单的使用方式是创建一个导入配置脚本,例如 import.py:

import beangulp
from beancount_daoru import AlipayImporter

CONFIG = [
    AlipayImporter(
        account_mapping={
            "your-alipay-account-name": {
                None: "Assets:Alipay",
                "余额": "Assets:Alipay:Balance",
                "余额宝": "Assets:Alipay:YuEBao",
                "中国银行(xxxx)": "Assets:Bank:BOC",
            }
        },
        currency_mapping={
            None: "CNY",
        },
    ),
]

if __name__ == "__main__":
    ingest = beangulp.Ingest(CONFIG)
    ingest()

然后运行 beangulp 命令识别、导入并归档账单文件,例如:

# 识别账单文件
python import.py identify /path/to/your/bills/dir
# 导入账单文件
python import.py extract /path/to/your/bills/dir -o output.beancount
# 归档账单文件
python import.py archive /path/to/your/bills/dir -o /path/to/your/archive/dir

另一种方法是在 Fava 中进行可视化导入,需要在主账本中添加import-config 和 import-dirs 这两个配置,具体参阅 Fava 帮助文档。

工具通过文件名识别账单,导入时务必保留账单原始文件名。 更多使用用例可参考源码中示例。

延伸

相关项目

国内项目:

  • double-entry-generator: 基于规则将各种账单格式转换为 Beancount 或 Ledger 格式
    • BeanBridge: double-entry-generator 的 Web 前端实现
    • bill-parser: 将非 Excel 账单文件(PDF/EML 等)转换为 CSV 格式
  • beancount-gs: 基于 beancount 提供个人记账财务管理的 RESTful API 服务(包含前端页面)
  • Beancount-Trans: 一款(自托管)智能账单转换平台,帮助用户轻松将日常账单(如支付宝、微信支付、银行账单等)转换为专业记账格式,并提供完整的财务报表服务。
  • china_bean_importers: Beancount 导入脚本,不支持 Beancount 3
  • beancount-homemade-importers: 一些在中国用的Beancount导入设置
  • beancount_cc_importers: Simple importers for personal usage

国外项目:

  • smart_importer: beancount 官方提供的基于机器学习的分类预测器
  • Beancount Red's Importers: Simple ingesting tools for Beancount. More importantly, a framework to allow you to easily write your own importers.
  • Beanborg: Automatic AI-powered transactions categorizer for Beancount.
  • BeanHub Import: a simple, declarative, smart, and easy-to-use library for importing extracted transactions from beanhub-extract.
  • beanquery-mcp: Beancount MCP Server is an experimental implementation that utilizes the Model Context Protocol (MCP) to enable AI assistants to query and analyze Beancount ledger files using Beancount Query Language (BQL) and the beanquery tool.

不活跃项目:

  • bento: A personal finance management system built with Beancount and Fava, providing automated transaction imports and classification.
  • Beancount-CSVImporter: CSVImporter for beancount, mainly used to import transaction records of Alipay and WeChat
  • BeancountSample: BeancountSample
  • beancount_importer: a GUI tool for importing Alipay/Wechat bill to beancount file
  • beancollect: 为 beancount 开发的账单导入工具

推荐阅读

基础:

使用分享:

自动化探讨:

LLM 研究:

Metadata

Release files for beancount-daoru 0.3.1

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

Source distribution (sdist)

Source distribution for beancount-daoru 0.3.1
File Size Uploaded
beancount_daoru-0.3.1.tar.gz 633.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beancount-daoru 0.3.1
File Interpreter ABI Platform
beancount_daoru-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 674.3 kB

Release files / beancount_daoru-0.3.1.tar.gz

Download URL beancount_daoru-0.3.1.tar.gz
Size 633.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4cc624c1e69d0798943cee812abfc6a0b0712d1b709e062215b113d374eaa34b
BLAKE2b-256 checksum
How to use checksums
e17e2e7ecc4d0a90bd674b875906752779ee382b8e034e70d7a4cbd4b9a43ef5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / beancount_daoru-0.3.1-py3-none-any.whl

Download URL beancount_daoru-0.3.1-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b4162a80bd247cb51880b70b0aa765bf91263e945a2d4214db7cb25b926d86c
BLAKE2b-256 checksum
How to use checksums
5f60eea1206065a5ce1267ac97fd1f7d5283b7f2606565de19b7ce0b5c40cb50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

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