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.
Modifications to schurig/ynab-bank-importer
- 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
- Most German and Austrian banks (all banks that implement the FinTS standard)
- BBVA Spain (private accounts only)
- N26
- Barclaycard
YNAB only supports U.S. and Canadian Banks for now.
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!
-
Install docker and docker-compose
-
Create a
docker-compose.yml
file with this content -
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
docker-compose pull importer && docker-compose run importer
-
Set up a Dokku host as described in the docs.
-
Create an app:
dokku apps:create ynab-bank-importer
-
Set a custom Docker option for headless Chromium (Barclaycard dumper) to work:
dokku docker-options:add ynab-bank-importer deploy "--shm-size=256m"
-
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"
-
Deploy the app:
git remote add deploy dokku@DOKKU-HOST:ynab-bank-importer git push deploy master
The FinTS / HBCI standard is mainly implemented by German banks.
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.
- 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.
memo
is a combination of the reference text and the city of the transaction provided by N26.
- 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.
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.
The field payee
will be N/A
because we currently don't get the payee name.
The ield payee
will be N/A
because we currently don't get the payee name.
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).
-
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 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).
- @mkilling for writing the FinTS ruby lib that I'm using & helping me fixing a bug
- @wizonesolutions for giving feedback on the N26 integration and PR #9
- you for reading this