# beancount-capitalone
[![PyPI](https://img.shields.io/pypi/v/beancount-capitalone)](https://pypi.org/project/beancount-capitalone/)
[![CircleCI](https://circleci.com/gh/mtlynch/beancount-capitalone.svg?style=svg)](https://circleci.com/gh/mtlynch/beancount-capitalone)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](LICENSE)
beancount-capitalone provides an Importer for converting CSV exports Capital One bank transactions into [Beancount](https://github.com/beancount/beancount) v2 format.
## Installation
```bash
pip install beancount-capitalone
```
## Usage
### Credit Cards
Add the Capital One Credit card importer to your account as follows:
```python
import beancount_capitalone
CONFIG = [
beancount_capitalone.CreditImporter(
'Liabilities:Credit-Cards:CapitalOne',
currency='USD',
lastfour='1234', # Replace with last four digits of your account
account_patterns=[
# These are example patterns. You can add your own.
('GITHUB', 'Expenses:Cloud-Services:Source-Hosting:Github'),
('Fedex', 'Expenses:Postage:FedEx'),
]
),
]
```
Once this configuration is in place, you can use `bean-extract` to convert a CapitalOne CSV export of transactions to beancount format:
```bash
bean-extract config.py 2023-03-10_transaction_download.csv
```
## API
### `account_patterns`
The `account_patterns` parameter is a list of (regex, account) pairs. For each line in your CSV, the CapitalOne importer will attempt to create a matching posting on the transaction by matching the payee, narration, or the concatenated pair to the regexes.
The regexes are in priority order, with earlier patterns taking priority over later patterns.
## Resources
See [awesome-beancount](https://awesome-beancount.com/) for other publicly available Beancount importers.
Raw data
{
"_id": null,
"home_page": "https://github.com/mtlynch/beancount-capitalone.git",
"name": "beancount-capitalone",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "capitalone beancount bookkeeping finance",
"author": "Michael Lynch",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/06/17/1205655e6f2c82340b3cae04e192d5115d8786ef8c7d82093d22e75a14b2/beancount-capitalone-0.1.1.tar.gz",
"platform": null,
"description": "# beancount-capitalone\n\n[![PyPI](https://img.shields.io/pypi/v/beancount-capitalone)](https://pypi.org/project/beancount-capitalone/)\n[![CircleCI](https://circleci.com/gh/mtlynch/beancount-capitalone.svg?style=svg)](https://circleci.com/gh/mtlynch/beancount-capitalone)\n[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](LICENSE)\n\nbeancount-capitalone provides an Importer for converting CSV exports Capital One bank transactions into [Beancount](https://github.com/beancount/beancount) v2 format.\n\n## Installation\n\n```bash\npip install beancount-capitalone\n```\n\n## Usage\n\n### Credit Cards\n\nAdd the Capital One Credit card importer to your account as follows:\n\n```python\nimport beancount_capitalone\n\nCONFIG = [\n beancount_capitalone.CreditImporter(\n 'Liabilities:Credit-Cards:CapitalOne',\n currency='USD',\n lastfour='1234', # Replace with last four digits of your account\n account_patterns=[\n # These are example patterns. You can add your own.\n ('GITHUB', 'Expenses:Cloud-Services:Source-Hosting:Github'),\n ('Fedex', 'Expenses:Postage:FedEx'),\n ]\n ),\n]\n```\nOnce this configuration is in place, you can use `bean-extract` to convert a CapitalOne CSV export of transactions to beancount format:\n\n```bash\nbean-extract config.py 2023-03-10_transaction_download.csv\n```\n\n## API\n\n### `account_patterns`\n\nThe `account_patterns` parameter is a list of (regex, account) pairs. For each line in your CSV, the CapitalOne importer will attempt to create a matching posting on the transaction by matching the payee, narration, or the concatenated pair to the regexes.\n\nThe regexes are in priority order, with earlier patterns taking priority over later patterns.\n\n## Resources\n\nSee [awesome-beancount](https://awesome-beancount.com/) for other publicly available Beancount importers.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Import CapitalOne banking transactions into beancount format",
"version": "0.1.1",
"split_keywords": [
"capitalone",
"beancount",
"bookkeeping",
"finance"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "908e25a4de95edadb53f52093676c6cecc3f76de5b85455af902bc999d575ad3",
"md5": "a30f6d0ca6c74488be7154ffd88bebc8",
"sha256": "ad088c0d9c193ab14b3c54f619b67f2d795a1c7724effe5ca535011df87614be"
},
"downloads": -1,
"filename": "beancount_capitalone-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a30f6d0ca6c74488be7154ffd88bebc8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 5427,
"upload_time": "2023-04-24T12:17:54",
"upload_time_iso_8601": "2023-04-24T12:17:54.306994Z",
"url": "https://files.pythonhosted.org/packages/90/8e/25a4de95edadb53f52093676c6cecc3f76de5b85455af902bc999d575ad3/beancount_capitalone-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "06171205655e6f2c82340b3cae04e192d5115d8786ef8c7d82093d22e75a14b2",
"md5": "3673730715a86995cd157373e077dbfb",
"sha256": "30caa2c826a602f6767d28f60e869da9a480f434df4d5eb70adb4b1489c9ea5a"
},
"downloads": -1,
"filename": "beancount-capitalone-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "3673730715a86995cd157373e077dbfb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 3996,
"upload_time": "2023-04-24T12:17:55",
"upload_time_iso_8601": "2023-04-24T12:17:55.839011Z",
"url": "https://files.pythonhosted.org/packages/06/17/1205655e6f2c82340b3cae04e192d5115d8786ef8c7d82093d22e75a14b2/beancount-capitalone-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-24 12:17:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "mtlynch",
"github_project": "beancount-capitalone.git",
"lcname": "beancount-capitalone"
}