This open-source bank teller can be used to access your bank balances in Sbanken using their open APIs.
- See your account balances
- Transfer money between your own accounts
- List and see totals of your transactions
- Search in your transactions
- You must have Python 2.x installed
- You must be a customer of Sbanken have enabled "beta" access at https://secure.sbanken.no/Home/Settings/BetaProgram and created an application at https://secure.sbanken.no/Personal/ApiBeta/Info.
You can download the script using git clone
:
git clone https://github.com/roys/python-cli-teller.git
You then might need to download a couple of Python libraries:
cd python-cli-teller
pip install --user -r requirements.txt
(remove --user
to do a global installation of the libs)
If you want to be able to just type teller
in any directory instead of having to type python teller.py
you can create a shortcut:
chmod +x teller.py
ln -s $(pwd)/teller.py /usr/local/bin/teller
If you didn't create the shortcut in the last example you have to type python teller.py
. Otherwise:
teller
You will now be asked for the client ID, client secret and your user id. The user ID is your social security number.
If you want to run teller
without having to enter all those credentials you can choose your own password that only you will know. If you do that the password will be used as the key to encrypt the data you entered + a more temporarily access token that Sbanken's service returns.
You can print the help using teller -h
or teller --help
. To get help for one specifc command you can type teller {comand} -h
, e.g. teller trans -h
.
Listing the balances is the default command (and an alias of typing teller accounts
):
teller
To transfer money between your accounts you just type as follows:
teller transfer {from account number/name/position} {to account number/name/position} {amount} [message]
The account "position" is the position that is printed in the left column when doing the command teller
. You don't have to match the casing if using the account name. You can mix between using account name, account number and account positions as desired.
The message is optional. If you have a message with several words you need to use an apostrophe (') or quotation mark (") in the start and end of the message.
To list the transactions for the last 30 days you just type:
teller trans {account number/name/position}
The account "position" is the position that is printed in the left column when doing the command teller
. You don't have to match the casing if using the account name.
You can also specify a start date of the the transaction and an optional end date. If there are more than 1000 transactions you can page the data as well:
teller trans {account} [start] [end] [index] [quantity]
The date format is relatively forgiving, so you can choose between typing e.g. 1 july 2017
and 2017-07-01
.
This is a pretty neat function. Be sure to read about all the other options for listing transactions. In addition to the listing teller
can do a local search from the data returned and only show those and the sum of those.
To e.g. sum up all interests for the year 2017 you could write as follows:
teller trans -s kreditrenter brukskonto "1 jan 2017" "31 dec 2017"
The script has language support for English and Norwegian. English is default, but it's very easy to change the preferred language:
teller -l {no|en}
The language strings can be found in the strings_*.ini
files.