Skip to main content

A beancount importer for CMB.

Project description

Beancount CMB Importer

Build and Publish - action Lint - action Coverage Status Code scanning - action PyPI version

Beancount CMB Importer 是一个用于将招商银行 PDF 交易流水导入 Beancount 的 Python 库。

安装

使用 pip 安装 Beancount CMB Importer:

pip install beancount-cmb-importer

使用方法

  1. 登陆招商银行手机银行 App,把交易流水发送到您的邮箱中。然后下载邮箱中的附件,并把附件解压之后的 pdf 放在 documents 目录下。
  2. 在您的 Beancount 文件夹中,创建一个新的 Python 脚本(例如:config.py),并将以下代码复制到脚本中:
from beancmb.pdf_importer import CmbPdfImporter

CONFIG = [
    CmbPdfImporter('Assets:Current:CMB', './main.bean'),
]
  1. 使用 bean-extract 来提取交易记录: bean-extract config.py documents/。这将从 PDF 文件中提取交易并将其转换为 Beancount 格式。您可以将其复制并粘贴到您的 Beancount 主文件中。

注意事项

  • 在导入时,会识别主账本中对应账户的最后一次 balance 记录的日期,只有晚于这个日期的交易才会被导入
  • 导入的交易,会默认添加一个去向账户 Equity:UFO。如果想自定义这个账户,可以通过 CmbPdfImporter 的参数来指定: CmbPdfImporter('Assets:Current:CMB', './main.bean', 'Expenses:Others')

License

MIT.

Project details


Download files

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

Source Distribution

beancount-cmb-importer-0.1.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

beancount_cmb_importer-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file beancount-cmb-importer-0.1.3.tar.gz.

File metadata

  • Download URL: beancount-cmb-importer-0.1.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for beancount-cmb-importer-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9a06ef4587e414752fa714c595818ca95a3aa0755b34a391374615a80343c7fc
MD5 a6772c215f3b2f567a338ead7c2909ed
BLAKE2b-256 68fcb2e7f2e4a8e1cffaeffecffcb07b4d5cdf39fad9ac0a283fff67841bd033

See more details on using hashes here.

File details

Details for the file beancount_cmb_importer-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for beancount_cmb_importer-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e28812f88ff3acab91a699c9f8e342925611d239aa3d591690030c526e6e146b
MD5 abc008090f829ca041cd07d7259f8606
BLAKE2b-256 fa6d34f7dac1727a295cee6c51bbbc0cb5a08a5b00c731b9e0482dbc49f3e17b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page