Imports transactions from banks via TrueLayer, a bank API aggregator.
-
Create an account with TrueLayer.
-
Create an app in live environment in TrueLayer console. You will be given a client id and a client secret in this step.
-
Configure
autobean.truelayer
in your beancount importer config. If you don't already have an importer config, create aimport_config.py
in your ledger directory with the following content:import autobean.truelayer CONFIG = [ autobean.truelayer.Importer(CLIENT_ID, CLIENT_SECRET), ]
-
Create an empty file ending with
.truelayer.yaml
in your ledger directory for each bank. -
Run
bean-extract path/to/import_config.py path/to/bank.truelayer.yaml
-
Following the popup browser window (or the printed link) to complete the authorization process.
-
You will see your recent transactions printed.
After the initial setup, you might want to edit the .truelayer.yaml
file to map your bank accounts to beancount accounts, disable accounts you would like to ignore or set the timestamp to start import. See Config section below.
With a proper config, you will be able to import transactions with bean-extract
command. The authorization should typically be valid for 90 days after which the command will prompt for a re-authorization.
.truelayer.yaml
files contain the following fields:
access_token
,access_token_expiry_time
,refresh_token
: TrueLayer OAuth credentials. Don't alter.accounts
,cards
: Maps from account ids (don't alter) to accounts, which contain the following fieldsbeancount_account
: The corresponding beancount account name. Multiple accounts can be mapped into one beancount account. Balance assertions may not work correctly if they share common currencies.enabled
: If set tofalse
, this account will be ignored.liability
: If set totrue
, the sign of account balance will be flipped.from
: A timestamp in seconds since which the transactions should be fetched.name
: A string for human to identify the account. Not consumed by the importer.