Git Product home page Git Product logo

beancount-ing's Introduction

Beancount ING Importer

image

image

image

image

beancount-ing provides an Importer for converting CSV exports of ING (Germany) account summaries to the Beancount format.

Installation

$ pip install beancount-ing

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

If you're not familiar with how to import external data into Beancount, please read this guide first.

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.

[tool.beancount-ing.ec]
iban = "DE99 9999 9999 9999 9999 99"
account_name = "Assets:ING:EC"
user = "Erika Mustermann"
file_encoding = "ISO-8859-1"  # optional

Run beancount-ing-ec to call the EC importer. The identify and extract subcommands would identify the file and extract transactions for you.

$ beancount-ing-ec extract transaction.csv >> you.beancount

Beancount 2.x

Adjust your config file to include the provided ECImporter. A sample configuration might look like the following:

from beancount_ing import ECImporter

CONFIG = [
    # ...

    ECImporter(
        IBAN_NUMBER,
        "Assets:ING:EC",
        "Erika Mustermann",
        file_encoding="ISO-8859-1",
    ),

    # ...
]

Once this is in place, you should be able to run bean-extract on the command line to extract the transactions and pipe all of them into your Beancount file.

$ bean-extract /path/to/config.py transaction.csv >> you.beancount

Contributing

Contributions are most welcome!

Please make sure you have Python 3.8+ and Poetry installed.

  1. Clone the repository: git clone https://github.com/siddhantgoel/beancount-ing
  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 pytest tests/.

beancount-ing's People

Contributors

dependabot[bot] avatar dotlambda avatar ganneff avatar pyup-bot avatar siddhantgoel avatar szabootibor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

beancount-ing's Issues

Unexpected sorting info line

Hi,

my ING CSV exports contain a header line that says something about sort order.

...
Saldo;XX,XX;EUR

Sortierung;Datum absteigend   <= HERE

In der CSV-Datei finden Sie alle bereits gebuchten Umsätze. Die vorgemerkten Umsätze werden nicht aufgenommen, auch wenn sie in Ihrem Internetbanking angezeigt werden.
...

This line seems to be unexpected in your importer.
https://github.com/siddhantgoel/beancount-ing-diba/blob/5a23c2bcf23cf7d69232d10c3786a42d89ea5b59/beancount_ing_diba/ec.py#L171-L179
Could you please check this?

Thanks and regards
Fred

User name restricted to two words

There seems to be a bug with user names, that consist of more than two words (first name + last name). See error output below. There should not be any restriction in this regard in order to make the package usable for everyone.

ERROR:root:Importer beancount_ing_diba.ec.ECImporter.extract() raised an unexpected error: too many values to unpack (expected 9)
Traceback (most recent call last):
  File "/Users/USERNAME/.virtualenvs/ENV/lib/python3.8/site-packages/beancount/ingest/extract.py", line 182, in extract
    new_entries = extract_from_file(
  File "/Users/USERNAME/.virtualenvs/ENV/lib/python3.8/site-packages/beancount/ingest/extract.py", line 67, in extract_from_file
    new_entries = importer.extract(file, **kwargs)
  File "/Users/USERNAME/.virtualenvs/ENV/lib/python3.8/site-packages/beancount_ing_diba/ec.py", line 210, in extract
    (
ValueError: too many values to unpack (expected 9)

When the name is reduced to two words (which does not match the name associated with the bank account in my case), the script runs through and gives the following output:
;; -*- mode: beancount -*-

Any chance, you can fix this soon?

Thanks for the great work!

How to use it exactly

Sorry for bothering you with the maybe simple question but I've just started to use beancount and its documentation about importers does not help me much. In the usage section of your importer project, you just posted a small python script which contains an import and an example configuration array. But I don't know where to put this file and it does not tell me how it is executed.

Could you clarify this eventually?

Thank you in advance.

Category not represented

Hi,

For me the importer only worked after I added the "Category" field. I think it's only active if you activated the "Analyse" as a user. Would be nice to have the option to activate/deactivate it.

Moreover, it's possible to download CSVs that don't have a Balance (Saldo), but this importer expects it to be there. Would be nice to mention this in the docs.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.