-
Notifications
You must be signed in to change notification settings - Fork 31
/
dkb_example.py
57 lines (44 loc) · 1.42 KB
/
dkb_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" example script for dkb-robo """
from __future__ import print_function
import sys
from pprint import pprint
from dkb_robo import DKBRobo
if sys.version_info > (3, 0):
import http.cookiejar as cookielib
import importlib
importlib.reload(sys)
else:
import cookielib
reload(sys)
sys.setdefaultencoding('utf8')
if __name__ == "__main__":
DKB_USER = 'xxxxxxx'
DKB_PASSWORD = '*****'
DKB = DKBRobo()
# Using a Contexthandler (with) makes sure that the connection is closed after use
with DKBRobo(dkb_user=DKB_USER, dkb_password=DKB_PASSWORD) as dkb:
print(dkb.last_login)
pprint(dkb.account_dic)
# get transaction
LINK = dkb.account_dic[0]['transactions']
TYPE = dkb.account_dic[0]['type']
DATE_FROM = '01.03.2020'
DATE_TO = '31.03.2020'
TRANSACTION_LIST = dkb.get_transactions(LINK, TYPE, DATE_FROM, DATE_TO)
pprint(TRANSACTION_LIST)
# get dkb postbox
POSTBOX_DIC = dkb.scan_postbox()
pprint(POSTBOX_DIC)
# get credit limits
CLI = dkb.get_credit_limits()
pprint(CLI)
# get standing orders (daueraufträge)
STO = dkb.get_standing_orders()
pprint(STO)
# get freitstellungsaufträge
EXO = dkb.get_exemption_order()
pprint(EXO)
POINTS_DIC = dkb.get_points()
pprint(POINTS_DIC)