# 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.
Note that v1.x will *only* work with Beancount 3.x, while v0.x will *only* work with
Beancount 2.x, due to incompatibilities between Beancount 3.x and 2.x.
## Usage
### Beancount 3.x
Beancount 3.x has replaced the `config.py` file based workflow in favor of having a
script based workflow, as per the [changes documented here]. As a result, the importer's
initialization parameters have been shifted to `pyproject.toml`.
Add the following to your `pyproject.toml` in your project root.
```toml
[tool.beancount-n26]
ibn = "IBAN_NUMBER" # required
account_name = "Assets:N26" # required
language = "en"
file_encoding = "utf-8"
```
### Beancount 2.x
Add the following to your `config.py`.
```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` parameter. The key should be the account name and the items in the
list are regular expressions that should match a `payee`.
A few helper functions have been provided in
`beancount_n26/utils/patterns_generation.py` to help you generate this dictionnary.
#### Beancount 3.x
```toml
[tool.beancount-n26.account_patterns]
"Expenses:Supermarket" = ["REWE", "ALDI"]
```
#### Beancount 2.x
```python
from beancount_n26 import N26Importer
CONFIG = [
N26Importer(
...
account_patterns={"Expenses:Supermarket": ["REWE", "ALDI"]}
),
]
```
### Multiple-currency transactions
To mark transaction fees associated with multiple-currency transactions, you can
specify the `exchange_fees_account` parameter.
#### Beancount 3.x
```toml
[tool.beancount-n26]
ibn = "IBAN_NUMBER" # required
account_name = "Assets:N26" # required
language = "en"
file_encoding = "utf-8"
exchange_fees_account = "Expenses:TransferWise"
```
#### Beancount 2.x
```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.8+ 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 task test`.
[Beancount]: http://furius.ca/beancount/
[N26]: https://n26.com/
[Poetry]: https://python-poetry.org/
[changes documented here]: https://docs.google.com/document/d/1O42HgYQBQEna6YpobTqszSgTGnbRX7RdjmzR2xumfjs/edit#heading=h.hjzt0c6v8pfs
Raw data
{
"_id": null,
"home_page": "https://github.com/siddhantgoel/beancount-n26",
"name": "beancount-n26",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.8.1",
"maintainer_email": null,
"keywords": "banking, beancount, cli-accounting, finance",
"author": "Siddhant Goel",
"author_email": "me@sgoel.dev",
"download_url": "https://files.pythonhosted.org/packages/9b/30/a25c04b5c798d9a761b977ed45fc95688683fe1ab9a8ffb20e0b89f8f77f/beancount_n26-1.1.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 `main` is the\ndevelopment branch so `stable` is what you should be installing from.\n\nNote that v1.x will *only* work with Beancount 3.x, while v0.x will *only* work with\nBeancount 2.x, due to incompatibilities between Beancount 3.x and 2.x.\n\n## Usage\n\n### Beancount 3.x\n\nBeancount 3.x has replaced the `config.py` file based workflow in favor of having a\nscript based workflow, as per the [changes documented here]. As a result, the importer's\ninitialization parameters have been shifted to `pyproject.toml`.\n\nAdd the following to your `pyproject.toml` in your project root.\n\n```toml\n[tool.beancount-n26]\nibn = \"IBAN_NUMBER\" # required\naccount_name = \"Assets:N26\" # required\nlanguage = \"en\"\nfile_encoding = \"utf-8\"\n```\n\n### Beancount 2.x\n\nAdd the following to your `config.py`.\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` parameter. The key should be the account name and the items in the\nlist are regular expressions that should match a `payee`.\n\nA few helper functions have been provided in\n`beancount_n26/utils/patterns_generation.py` to help you generate this dictionnary.\n\n#### Beancount 3.x\n\n```toml\n[tool.beancount-n26.account_patterns]\n\"Expenses:Supermarket\" = [\"REWE\", \"ALDI\"]\n```\n\n#### Beancount 2.x\n\n```python\nfrom beancount_n26 import N26Importer\n\nCONFIG = [\n N26Importer(\n ...\n account_patterns={\"Expenses:Supermarket\": [\"REWE\", \"ALDI\"]}\n ),\n]\n```\n\n### Multiple-currency transactions\n\nTo mark transaction fees associated with multiple-currency transactions, you can\nspecify the `exchange_fees_account` parameter.\n\n#### Beancount 3.x\n\n```toml\n[tool.beancount-n26]\nibn = \"IBAN_NUMBER\" # required\naccount_name = \"Assets:N26\" # required\nlanguage = \"en\"\nfile_encoding = \"utf-8\"\nexchange_fees_account = \"Expenses:TransferWise\"\n```\n\n#### Beancount 2.x\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 foreign\ncurrency are given, the importer will calculate the transaction fee based on the\nexchange rate included in the CSV export and automatically allocate the value to the\naccount specified in `exchange_fees_account`.\n\n## Contributing\n\nPlease make sure you have Python 3.8+ 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 task test`.\n\n[Beancount]: http://furius.ca/beancount/\n[N26]: https://n26.com/\n[Poetry]: https://python-poetry.org/\n[changes documented here]: https://docs.google.com/document/d/1O42HgYQBQEna6YpobTqszSgTGnbRX7RdjmzR2xumfjs/edit#heading=h.hjzt0c6v8pfs\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Beancount Importer for N26 CSV exports",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/siddhantgoel/beancount-n26",
"Repository": "https://github.com/siddhantgoel/beancount-n26"
},
"split_keywords": [
"banking",
" beancount",
" cli-accounting",
" finance"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "99e82583efb90e9624fb036a65328158e42db5041277f0361ae3981a38bc3e79",
"md5": "f8c8674d3774e494e6ba7a5b8a2e3550",
"sha256": "7b6d46b3193f876e470f30f4b7ff220e909fef5263f1ec0cac15c880ba980940"
},
"downloads": -1,
"filename": "beancount_n26-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8c8674d3774e494e6ba7a5b8a2e3550",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.8.1",
"size": 10107,
"upload_time": "2024-07-09T18:01:49",
"upload_time_iso_8601": "2024-07-09T18:01:49.261098Z",
"url": "https://files.pythonhosted.org/packages/99/e8/2583efb90e9624fb036a65328158e42db5041277f0361ae3981a38bc3e79/beancount_n26-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b30a25c04b5c798d9a761b977ed45fc95688683fe1ab9a8ffb20e0b89f8f77f",
"md5": "352ae014e079dd4959d12eaf6b8a006d",
"sha256": "ada93d40f7c402cab11e97e0d419c8a1c51823464c8df191be8223696817d7d3"
},
"downloads": -1,
"filename": "beancount_n26-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "352ae014e079dd4959d12eaf6b8a006d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.8.1",
"size": 6564,
"upload_time": "2024-07-09T18:01:51",
"upload_time_iso_8601": "2024-07-09T18:01:51.343950Z",
"url": "https://files.pythonhosted.org/packages/9b/30/a25c04b5c798d9a761b977ed45fc95688683fe1ab9a8ffb20e0b89f8f77f/beancount_n26-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-09 18:01:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "siddhantgoel",
"github_project": "beancount-n26",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "beancount-n26"
}