Skip to content

💰 Pull transactions from your bank and import them to YNAB automatically.

License

Notifications You must be signed in to change notification settings

Shark/ynab-bank-importer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank YNAB importer Docker Build Statu Docker Build Statu Maintainability

This is a ruby script that pulls your transactions from your banks and imports them into You Need A Budget (YNAB).

Mission: A script that can run every 15 minutes on a small and cheap mini-computer at your home (eg. raspberry pi) with an easy configuration and support for most European banks.

  • Added sentry-raven for error reporting
  • Added deployment configuration files for Dokku
  • The settings can be be passed in as an environment variable
  • Added clockwork for pulling and importing transactions periodically

Supported banks

  • Most German and Austrian banks (all banks that implement the FinTS standard)
  • BBVA Spain (private accounts only)
  • N26
  • Barclaycard

Why

YNAB only supports U.S. and Canadian Banks for now.

Usage (Docker)

You will need to obtain a personal access token. Here is a tutorial on how to do it.

If you clone this repository you don't need to follow step 2!

  1. Install docker and docker-compose

  2. Create a docker-compose.yml file with this content

  3. Create a config.yml

---
ynab:
  access_token: # ynab access token
  budget_id: # budget_id
  cash_account_id: # optional
accounts:
  - dumper: :n26
    iban: # iban of your n26
    ynab_id: # account id in YNAB
    username: # email
    password: # password

Example: config.sample.yml

  1. docker-compose pull importer && docker-compose run importer

Usage (Dokku)

  1. Set up a Dokku host as described in the docs.

  2. Create an app:

    dokku apps:create ynab-bank-importer

  3. Set a custom Docker option for headless Chromium (Barclaycard dumper) to work:

    dokku docker-options:add ynab-bank-importer deploy "--shm-size=256m"

  4. Encode the configuration and store it in an environment variable:

    CONFIG=$(base64 < config.yml)
    dokku config:set ynab-bank-importer YNAB_BANK_IMPORTER_CONFIG="$CONFIG"
    
  5. Deploy the app:

    git remote add deploy dokku@DOKKU-HOST:ynab-bank-importer
    git push deploy master
    

Dumpers

FinTS / HBCI :fints

The FinTS / HBCI standard is mainly implemented by German banks.

Options

  • fints_endpoint (required)

The endpoint is the url is needed to communicate with your bank to fetch the recent transactions. You can find it out by looking for it on the internet. If you don't find the endpoint please contact me (before the list was available online but the Deutsche Kreditwirtschaft decided to take it offline and require a registration with personal information) [email protected].

  • fints_blz (required)

This is the routing number / Bankleitzahl of your bank. You can find it out on the bank's website.

Notes

  • Currently tested with DKB and ING-DiBa.
  • !!! If you change your online banking password please don't run the importer with the wrong password. Your bank might lock your account if there are too many failed login attempts.
  • It currently fetches the transactions from the last 35 days. Please open an issue or PR if you want to change this.

N26 :n26

memo is a combination of the reference text and the city of the transaction provided by N26.

Note

  • It currently only fetches the last 100 transactions. Please open an issue or PR if you want to change this. For now I didn't see the use case for it.

Options

  • set_category (default: false)

Set the transaction category to the N26 category. Only makes sense if you have the N26 categories set up in your YNAB.

BBVA :bbva

The field payee will be N/A because we currently don't get the payee name.

Barclaycard :barclaycard

The ield payee will be N/A because we currently don't get the payee name.

Technical details on how it works

The script fetches the transaction information from your bank(s). Then it uses the official YNAB API to create the transactions for you.

The script also includes some additional logic like detecting internal transactions by checking if the account transactions go to or come from is one of the other accounts that you set up in the config (of course this only works if you have multiple accounts configured).

Known Problems

  • Internal transactions (transfer from one account to an other one) don't work yet. This is because the official YNAB API doesn't support the creation of internal transactions yet. Workaround: the script flags those transactions in orange, so you can quickly see them and manually edit them to be an internal transaction.

  • With N26 it could import a transactions twice from time to time. This is a problem on N26's side, because they change the id of the transaction sometimes. Workaround: when you see a transaction showing up twice, you can discard it. It's easy to spot because the payee, date and the price are usually the same.


Support / Contribution

Support and contriubution of any kind is always welcome!!!

I'm not that into hardware. It would be super awesome if someone could help making this work on Raspbian. I already tried but building the docker container fails (Dockerfile-rpi).

Thanks

About

💰 Pull transactions from your bank and import them to YNAB automatically.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 98.4%
  • Dockerfile 1.6%