Skip to main content

Beancount Importer for N26 CSV exports

Project description

Beancount N26 Importer

image image image Ruff

beancount-n26 provides a Beancount Importer for converting CSV exports of N26 account summaries to the Beancount format.

Installation

$ 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:

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.

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

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beancount_n26-1.5.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beancount_n26-1.5.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file beancount_n26-1.5.0.tar.gz.

File metadata

  • Download URL: beancount_n26-1.5.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.6.0

File hashes

Hashes for beancount_n26-1.5.0.tar.gz
Algorithm Hash digest
SHA256 3ea1396c06383c439970e40e8fa6919840e1d71d884fe267e7cf8a4f3869847f
MD5 d0a615a556482542e4211704984251aa
BLAKE2b-256 b823757c25001c2b10f33837e46cfa2a15f154c46d8b5cb6187af099eab874b1

See more details on using hashes here.

File details

Details for the file beancount_n26-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: beancount_n26-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.6.0

File hashes

Hashes for beancount_n26-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ff245a23e83e2c21f2db3061f98c3d4f9231b8bd07c18dccfce61f2a68cd762
MD5 2db1017b19392ade6361d6743221f93b
BLAKE2b-256 ac28171bf52686334c1dd6b6addbd033b7d1a6cdf2e8aa59108bcd47c7959b68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page