beancount-n26


Namebeancount-n26 JSON
Version 1.5.0 PyPI version JSON
download
home_pagehttps://github.com/siddhantgoel/beancount-n26
SummaryBeancount Importer for N26 CSV exports
upload_time2025-08-14 18:24:16
maintainerNone
docs_urlNone
authorSiddhant Goel
requires_python<4.0,>=3.9
licenseMIT
keywords banking beancount cli-accounting finance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

`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

### 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]. The `beangulp` examples
suggest using a Python script based on `beangulp.Ingest`. Here's an example of how that
might work:

Add an `import.py` script in your project root with the following contents:

```python
from beancount_n26 import N26Importer
from beangulp import Ingest

importers = (
    N26Importer(
        IBAN_NUMBER,
        'Assets:N26',
        language='en',
        file_encoding='utf-8',
    ),
)

if __name__ == "__main__":
    ingest = Ingest(importer)
    ingest()
```

... and run it directly using `python import.py extract`.

### 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

```python
from beancount_n26 import N26Importer
from beangulp import Ingest

importers = (
    N26Importer(
        IBAN_NUMBER,
        'Assets:N26',
        account_patterns={"Expenses:Supermarket": ["REWE", "ALDI"]}
    ),
)

if __name__ == "__main__":
    ingest = Ingest(importer)
    ingest()
```

#### Beancount 2.x

```python
from beancount_n26 import N26Importer

CONFIG = [
    N26Importer(
        ...
        account_patterns={"Expenses:Supermarket": ["REWE", "ALDI"]}
    ),
]
```

## Contributing

Please make sure you have Python 3.9+ 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,>=3.9",
    "maintainer_email": null,
    "keywords": "banking, beancount, cli-accounting, finance",
    "author": "Siddhant Goel",
    "author_email": "me@sgoel.dev",
    "download_url": "https://files.pythonhosted.org/packages/b8/23/757c25001c2b10f33837e46cfa2a15f154c46d8b5cb6187af099eab874b1/beancount_n26-1.5.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[![image](https://img.shields.io/pypi/v/beancount-n26.svg)](https://pypi.python.org/pypi/beancount-n26)\n[![image](https://img.shields.io/pypi/pyversions/beancount-n26.svg)](https://pypi.python.org/pypi/beancount-n26)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\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\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]. The `beangulp` examples\nsuggest using a Python script based on `beangulp.Ingest`. Here's an example of how that\nmight work:\n\nAdd an `import.py` script in your project root with the following contents:\n\n```python\nfrom beancount_n26 import N26Importer\nfrom beangulp import Ingest\n\nimporters = (\n    N26Importer(\n        IBAN_NUMBER,\n        'Assets:N26',\n        language='en',\n        file_encoding='utf-8',\n    ),\n)\n\nif __name__ == \"__main__\":\n    ingest = Ingest(importer)\n    ingest()\n```\n\n... and run it directly using `python import.py extract`.\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```python\nfrom beancount_n26 import N26Importer\nfrom beangulp import Ingest\n\nimporters = (\n    N26Importer(\n        IBAN_NUMBER,\n        'Assets:N26',\n        account_patterns={\"Expenses:Supermarket\": [\"REWE\", \"ALDI\"]}\n    ),\n)\n\nif __name__ == \"__main__\":\n    ingest = Ingest(importer)\n    ingest()\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## Contributing\n\nPlease make sure you have Python 3.9+ 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.5.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": "ac28171bf52686334c1dd6b6addbd033b7d1a6cdf2e8aa59108bcd47c7959b68",
                "md5": "2db1017b19392ade6361d6743221f93b",
                "sha256": "1ff245a23e83e2c21f2db3061f98c3d4f9231b8bd07c18dccfce61f2a68cd762"
            },
            "downloads": -1,
            "filename": "beancount_n26-1.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2db1017b19392ade6361d6743221f93b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 7150,
            "upload_time": "2025-08-14T18:24:15",
            "upload_time_iso_8601": "2025-08-14T18:24:15.682264Z",
            "url": "https://files.pythonhosted.org/packages/ac/28/171bf52686334c1dd6b6addbd033b7d1a6cdf2e8aa59108bcd47c7959b68/beancount_n26-1.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b823757c25001c2b10f33837e46cfa2a15f154c46d8b5cb6187af099eab874b1",
                "md5": "d0a615a556482542e4211704984251aa",
                "sha256": "3ea1396c06383c439970e40e8fa6919840e1d71d884fe267e7cf8a4f3869847f"
            },
            "downloads": -1,
            "filename": "beancount_n26-1.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d0a615a556482542e4211704984251aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 6171,
            "upload_time": "2025-08-14T18:24:16",
            "upload_time_iso_8601": "2025-08-14T18:24:16.816700Z",
            "url": "https://files.pythonhosted.org/packages/b8/23/757c25001c2b10f33837e46cfa2a15f154c46d8b5cb6187af099eab874b1/beancount_n26-1.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-14 18:24:16",
    "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"
}
        
Elapsed time: 1.93470s