Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtlynch/beancount-capitalone
Beancount importer for CapitalOne
https://github.com/mtlynch/beancount-capitalone
Last synced: 24 days ago
JSON representation
Beancount importer for CapitalOne
- Host: GitHub
- URL: https://github.com/mtlynch/beancount-capitalone
- Owner: mtlynch
- License: mit
- Created: 2023-03-10T14:33:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-16T13:51:38.000Z (about 2 months ago)
- Last Synced: 2024-09-16T16:17:51.566Z (about 2 months ago)
- Language: Python
- Size: 166 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-beancount - Capital One - installable) (Importers / US)
README
# 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_capitaloneCONFIG = [
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.