beancount-cmb-importer


Namebeancount-cmb-importer JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/e7h4n/beancount-cmb-importer
SummaryA beancount importer for CMB.
upload_time2023-03-17 11:40:52
maintainer
docs_urlNone
authore7h4n
requires_python>=3.6, <4
license
keywords beancount importer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Beancount CMB Importer

[![Build and Publish - action](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/build.yml/badge.svg)](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/build.yml)
[![Lint - action](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/lint.yaml/badge.svg)](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/lint.yaml)
[![Coverage Status](https://coveralls.io/repos/github/e7h4n/beancount-cmb-importer/badge.svg?branch=master)](https://coveralls.io/github/e7h4n/beancount-cmb-importer?branch=master)
[![Code scanning - action](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/codeql-analysis.yml)
[![PyPI version](https://badge.fury.io/py/beancount-cmb-importer.svg)](https://badge.fury.io/py/beancount-cmb-importer)

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

## 安装

使用 pip 安装 Beancount CMB Importer:

```bash
pip install beancount-cmb-importer
```

## 使用方法

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

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

## 注意事项

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


## License

MIT.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/e7h4n/beancount-cmb-importer",
    "name": "beancount-cmb-importer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6, <4",
    "maintainer_email": "",
    "keywords": "beancount,importer",
    "author": "e7h4n",
    "author_email": "ethan.pw@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/68/fc/b2e7f2e4a8e1cffaeffecffcb07b4d5cdf39fad9ac0a283fff67841bd033/beancount-cmb-importer-0.1.3.tar.gz",
    "platform": null,
    "description": "# Beancount CMB Importer\n\n[![Build and Publish - action](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/build.yml/badge.svg)](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/build.yml)\n[![Lint - action](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/lint.yaml/badge.svg)](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/lint.yaml)\n[![Coverage Status](https://coveralls.io/repos/github/e7h4n/beancount-cmb-importer/badge.svg?branch=master)](https://coveralls.io/github/e7h4n/beancount-cmb-importer?branch=master)\n[![Code scanning - action](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/e7h4n/beancount-cmb-importer/actions/workflows/codeql-analysis.yml)\n[![PyPI version](https://badge.fury.io/py/beancount-cmb-importer.svg)](https://badge.fury.io/py/beancount-cmb-importer)\n\nBeancount CMB Importer \u662f\u4e00\u4e2a\u7528\u4e8e\u5c06\u62db\u5546\u94f6\u884c PDF \u4ea4\u6613\u6d41\u6c34\u5bfc\u5165 Beancount \u7684 Python \u5e93\u3002\n\n## \u5b89\u88c5\n\n\u4f7f\u7528 pip \u5b89\u88c5 Beancount CMB Importer\uff1a\n\n```bash\npip install beancount-cmb-importer\n```\n\n## \u4f7f\u7528\u65b9\u6cd5\n\n1. \u767b\u9646\u62db\u5546\u94f6\u884c\u624b\u673a\u94f6\u884c App\uff0c\u628a\u4ea4\u6613\u6d41\u6c34\u53d1\u9001\u5230\u60a8\u7684\u90ae\u7bb1\u4e2d\u3002\u7136\u540e\u4e0b\u8f7d\u90ae\u7bb1\u4e2d\u7684\u9644\u4ef6\uff0c\u5e76\u628a\u9644\u4ef6\u89e3\u538b\u4e4b\u540e\u7684 pdf \u653e\u5728 documents \u76ee\u5f55\u4e0b\u3002\n2. \u5728\u60a8\u7684 Beancount \u6587\u4ef6\u5939\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Python \u811a\u672c\uff08\u4f8b\u5982\uff1aconfig.py\uff09\uff0c\u5e76\u5c06\u4ee5\u4e0b\u4ee3\u7801\u590d\u5236\u5230\u811a\u672c\u4e2d\uff1a\n```python\nfrom beancmb.pdf_importer import CmbPdfImporter\n\nCONFIG = [\n    CmbPdfImporter('Assets:Current:CMB', './main.bean'),\n]\n```\n3. \u4f7f\u7528 `bean-extract` \u6765\u63d0\u53d6\u4ea4\u6613\u8bb0\u5f55: `bean-extract config.py documents/`\u3002\u8fd9\u5c06\u4ece PDF \u6587\u4ef6\u4e2d\u63d0\u53d6\u4ea4\u6613\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a Beancount \u683c\u5f0f\u3002\u60a8\u53ef\u4ee5\u5c06\u5176\u590d\u5236\u5e76\u7c98\u8d34\u5230\u60a8\u7684 Beancount \u4e3b\u6587\u4ef6\u4e2d\u3002\n\n## \u6ce8\u610f\u4e8b\u9879\n\n* \u5728\u5bfc\u5165\u65f6\uff0c\u4f1a\u8bc6\u522b\u4e3b\u8d26\u672c\u4e2d\u5bf9\u5e94\u8d26\u6237\u7684\u6700\u540e\u4e00\u6b21 balance \u8bb0\u5f55\u7684\u65e5\u671f\uff0c\u53ea\u6709\u665a\u4e8e\u8fd9\u4e2a\u65e5\u671f\u7684\u4ea4\u6613\u624d\u4f1a\u88ab\u5bfc\u5165\n* \u5bfc\u5165\u7684\u4ea4\u6613\uff0c\u4f1a\u9ed8\u8ba4\u6dfb\u52a0\u4e00\u4e2a\u53bb\u5411\u8d26\u6237 `Equity:UFO`\u3002\u5982\u679c\u60f3\u81ea\u5b9a\u4e49\u8fd9\u4e2a\u8d26\u6237\uff0c\u53ef\u4ee5\u901a\u8fc7 `CmbPdfImporter` \u7684\u53c2\u6570\u6765\u6307\u5b9a: `CmbPdfImporter('Assets:Current:CMB', './main.bean', 'Expenses:Others')`\n\n\n## License\n\nMIT.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A beancount importer for CMB.",
    "version": "0.1.3",
    "split_keywords": [
        "beancount",
        "importer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa6d34f7dac1727a295cee6c51bbbc0cb5a08a5b00c731b9e0482dbc49f3e17b",
                "md5": "abc008090f829ca041cd07d7259f8606",
                "sha256": "e28812f88ff3acab91a699c9f8e342925611d239aa3d591690030c526e6e146b"
            },
            "downloads": -1,
            "filename": "beancount_cmb_importer-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "abc008090f829ca041cd07d7259f8606",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6, <4",
            "size": 8509,
            "upload_time": "2023-03-17T11:40:50",
            "upload_time_iso_8601": "2023-03-17T11:40:50.798261Z",
            "url": "https://files.pythonhosted.org/packages/fa/6d/34f7dac1727a295cee6c51bbbc0cb5a08a5b00c731b9e0482dbc49f3e17b/beancount_cmb_importer-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68fcb2e7f2e4a8e1cffaeffecffcb07b4d5cdf39fad9ac0a283fff67841bd033",
                "md5": "a6772c215f3b2f567a338ead7c2909ed",
                "sha256": "9a06ef4587e414752fa714c595818ca95a3aa0755b34a391374615a80343c7fc"
            },
            "downloads": -1,
            "filename": "beancount-cmb-importer-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a6772c215f3b2f567a338ead7c2909ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6, <4",
            "size": 6960,
            "upload_time": "2023-03-17T11:40:52",
            "upload_time_iso_8601": "2023-03-17T11:40:52.004526Z",
            "url": "https://files.pythonhosted.org/packages/68/fc/b2e7f2e4a8e1cffaeffecffcb07b4d5cdf39fad9ac0a283fff67841bd033/beancount-cmb-importer-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-17 11:40:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "e7h4n",
    "github_project": "beancount-cmb-importer",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "beancount-cmb-importer"
}
        
Elapsed time: 0.10698s