# Beancount N26 Importer
[![image](https://github.com/siddhantgoel/beancount-n26/workflows/beancount-n26/badge.svg)](https://github.com/siddhantgoel/beancount-n26/workflows/beancount-n26/badge.svg)
[![image](https://img.shields.io/pypi/v/beancount-n26.svg)](https://pypi.python.org/pypi/beancount-n26)
[![image](https://img.shields.io/pypi/pyversions/beancount-n26.svg)](https://pypi.python.org/pypi/beancount-n26)
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
`beancount-n26` provides a [Beancount] Importer for converting CSV exports of
[N26] account summaries to the Beancount format.
## Installation
```sh
$ pip install beancount-n26
```
In case you prefer installing from the Github repository, please note that
`main` is the development branch so `stable` is what you should be installing
from.
## Usage
```python
from beancount_n26 import N26Importer
CONFIG = [
N26Importer(
IBAN_NUMBER,
'Assets:N26',
language='en',
file_encoding='utf-8',
),
]
```
### Classification
To classify specific recurring transactions automatically, you can specify an
`account_patterns` as follows:
```python
from beancount_n26 import N26Importer
CONFIG = [
N26Importer(
IBAN_NUMBER,
'Assets:N26',
language='en',
file_encoding='utf-8',
account_patterns={
"Expenses:Food:Restaurants": [
"amorino",
"five guys.*",
]
}
),
]
```
The keys should be `accounts` while the items in the list are regular
expressions that should match a `payee`.
Some helper functions in `beancount_n26/utils/patterns_generation.py` are here
to help you generate this dictionnary.
### Multiple-currency transactions
To mark transaction fees associated with multiple-currency transactions, you can
specify the `exchange_fees_account` parameter as follows:
```python
from beancount_n26 import N26Importer
CONFIG = [
N26Importer(
IBAN_NUMBER,
'Assets:N26',
language='en',
file_encoding='utf-8',
exchange_fees_account='Expenses:TransferWise',
),
]
```
With this in place, for transactions where both the amount in EUR and amount in
foreign currency are given, the importer will calculate the transaction fee
based on the exchange rate included in the CSV export and automatically allocate
the value to the account specified in `exchange_fees_account`.
## Contributing
Please make sure you have Python 3.7+ and [Poetry] installed.
1. Git clone the repository -
`git clone https://github.com/siddhantgoel/beancount-n26`
2. Install the packages required for development -
`poetry install`
3. That's basically it. You should now be able to run the test suite -
`poetry run py.test`.
[Beancount]: http://furius.ca/beancount/
[N26]: https://n26.com/
[Poetry]: https://poetry.eustace.io/
Raw data
{
"_id": null,
"home_page": "https://github.com/siddhantgoel/beancount-n26",
"name": "beancount-n26",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "banking,beancount,cli-accounting,finance",
"author": "Siddhant Goel",
"author_email": "me@sgoel.dev",
"download_url": "https://files.pythonhosted.org/packages/4a/19/73c1bacdc22912a03e00cfc2ea501f93f4a75c5da3a823c8aca1cbe58b39/beancount_n26-0.8.0.tar.gz",
"platform": null,
"description": "# Beancount N26 Importer\n\n[![image](https://github.com/siddhantgoel/beancount-n26/workflows/beancount-n26/badge.svg)](https://github.com/siddhantgoel/beancount-n26/workflows/beancount-n26/badge.svg)\n\n[![image](https://img.shields.io/pypi/v/beancount-n26.svg)](https://pypi.python.org/pypi/beancount-n26)\n\n[![image](https://img.shields.io/pypi/pyversions/beancount-n26.svg)](https://pypi.python.org/pypi/beancount-n26)\n\n[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n`beancount-n26` provides a [Beancount] Importer for converting CSV exports of\n[N26] account summaries to the Beancount format.\n\n## Installation\n\n```sh\n$ pip install beancount-n26\n```\n\nIn case you prefer installing from the Github repository, please note that\n`main` is the development branch so `stable` is what you should be installing\nfrom.\n\n## Usage\n\n```python\nfrom beancount_n26 import N26Importer\n\nCONFIG = [\n N26Importer(\n IBAN_NUMBER,\n 'Assets:N26',\n language='en',\n file_encoding='utf-8',\n ),\n]\n```\n\n### Classification\n\nTo classify specific recurring transactions automatically, you can specify an\n`account_patterns` as follows:\n\n```python\nfrom beancount_n26 import N26Importer\n\nCONFIG = [\n N26Importer(\n IBAN_NUMBER,\n 'Assets:N26',\n language='en',\n file_encoding='utf-8',\n account_patterns={\n \"Expenses:Food:Restaurants\": [\n \"amorino\",\n \"five guys.*\",\n ]\n }\n ),\n]\n```\n\nThe keys should be `accounts` while the items in the list are regular\nexpressions that should match a `payee`.\n\nSome helper functions in `beancount_n26/utils/patterns_generation.py` are here\nto help you generate this dictionnary.\n\n### Multiple-currency transactions\n\nTo mark transaction fees associated with multiple-currency transactions, you can\nspecify the `exchange_fees_account` parameter as follows:\n\n```python\nfrom beancount_n26 import N26Importer\n\nCONFIG = [\n N26Importer(\n IBAN_NUMBER,\n 'Assets:N26',\n language='en',\n file_encoding='utf-8',\n exchange_fees_account='Expenses:TransferWise',\n ),\n]\n```\n\nWith this in place, for transactions where both the amount in EUR and amount in\nforeign currency are given, the importer will calculate the transaction fee\nbased on the exchange rate included in the CSV export and automatically allocate\nthe value to the account specified in `exchange_fees_account`.\n\n## Contributing\n\nPlease make sure you have Python 3.7+ and [Poetry] installed.\n\n1. Git clone the repository -\n `git clone https://github.com/siddhantgoel/beancount-n26`\n\n2. Install the packages required for development -\n `poetry install`\n\n3. That's basically it. You should now be able to run the test suite -\n `poetry run py.test`.\n\n[Beancount]: http://furius.ca/beancount/\n[N26]: https://n26.com/\n[Poetry]: https://poetry.eustace.io/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Beancount Importer for N26 CSV exports",
"version": "0.8.0",
"split_keywords": [
"banking",
"beancount",
"cli-accounting",
"finance"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "f5cc23e442f1ce4a2d3559bec9d04167",
"sha256": "79f746297d342e1a25e1d254e9a5ac147d1477d55e3eb5a57c7667d8e4d3f87d"
},
"downloads": -1,
"filename": "beancount_n26-0.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f5cc23e442f1ce4a2d3559bec9d04167",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 8482,
"upload_time": "2022-12-11T18:34:08",
"upload_time_iso_8601": "2022-12-11T18:34:08.998199Z",
"url": "https://files.pythonhosted.org/packages/f2/7c/2515d8ad05774588e4cb2a52bcce6092a2e3b5a4824ad4de4fb1f895ebb4/beancount_n26-0.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "6a74571530fa9a59421ea48bac75f8e3",
"sha256": "e6bccab0420825ff4f97e99c314f78d70da666c886fc81c603b7bdf2a01fc0c2"
},
"downloads": -1,
"filename": "beancount_n26-0.8.0.tar.gz",
"has_sig": false,
"md5_digest": "6a74571530fa9a59421ea48bac75f8e3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 6292,
"upload_time": "2022-12-11T18:34:10",
"upload_time_iso_8601": "2022-12-11T18:34:10.634509Z",
"url": "https://files.pythonhosted.org/packages/4a/19/73c1bacdc22912a03e00cfc2ea501f93f4a75c5da3a823c8aca1cbe58b39/beancount_n26-0.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-11 18:34:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "siddhantgoel",
"github_project": "beancount-n26",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "beancount-n26"
}