tariochbctools 1.2.3__py2.py3-none-any.whl → 1.3.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tariochbctools/importers/nordigen/importer.py +2 -2
- tariochbctools/importers/nordigen/nordigen_config.py +50 -6
- {tariochbctools-1.2.3.dist-info → tariochbctools-1.3.0.dist-info}/METADATA +1 -1
- {tariochbctools-1.2.3.dist-info → tariochbctools-1.3.0.dist-info}/RECORD +8 -8
- {tariochbctools-1.2.3.dist-info → tariochbctools-1.3.0.dist-info}/WHEEL +0 -0
- {tariochbctools-1.2.3.dist-info → tariochbctools-1.3.0.dist-info}/entry_points.txt +0 -0
- {tariochbctools-1.2.3.dist-info → tariochbctools-1.3.0.dist-info}/licenses/LICENSE.txt +0 -0
- {tariochbctools-1.2.3.dist-info → tariochbctools-1.3.0.dist-info}/top_level.txt +0 -0
@@ -28,7 +28,7 @@ class Importer(beangulp.Importer):
|
|
28
28
|
config = yaml.safe_load(f)
|
29
29
|
|
30
30
|
r = requests.post(
|
31
|
-
"https://
|
31
|
+
"https://bankaccountdata.gocardless.com/api/v2/token/new/",
|
32
32
|
data={
|
33
33
|
"secret_id": config["secret_id"],
|
34
34
|
"secret_key": config["secret_key"],
|
@@ -47,7 +47,7 @@ class Importer(beangulp.Importer):
|
|
47
47
|
accountId = account["id"]
|
48
48
|
assetAccount = account["asset_account"]
|
49
49
|
r = requests.get(
|
50
|
-
f"https://
|
50
|
+
f"https://bankaccountdata.gocardless.com/api/v2/accounts/{accountId}/transactions/",
|
51
51
|
headers=headers,
|
52
52
|
)
|
53
53
|
try:
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import argparse
|
2
2
|
import sys
|
3
|
+
from json import JSONDecoder
|
3
4
|
from typing import Any
|
4
5
|
|
5
6
|
import requests
|
@@ -41,24 +42,45 @@ def list_bank(token: str, country: str) -> None:
|
|
41
42
|
print(asp["name"] + ": " + asp["id"]) # noqa: T201
|
42
43
|
|
43
44
|
|
44
|
-
def create_link(
|
45
|
+
def create_link(
|
46
|
+
token: str,
|
47
|
+
reference: str,
|
48
|
+
bank: str,
|
49
|
+
max_historical_days: str,
|
50
|
+
access_valid_for_days: str,
|
51
|
+
access_scope: str,
|
52
|
+
) -> None:
|
45
53
|
if not bank:
|
46
54
|
raise Exception("Please specify --bank it is required for create_link")
|
47
55
|
requisitionId = _find_requisition_id(token, reference)
|
48
56
|
if requisitionId:
|
49
57
|
print(f"Link for for reference {reference} already exists.") # noqa: T201
|
50
58
|
else:
|
51
|
-
|
59
|
+
decoder = JSONDecoder()
|
60
|
+
r1 = requests.post(
|
61
|
+
"https://bankaccountdata.gocardless.com/api/v2/agreements/enduser/",
|
62
|
+
data={
|
63
|
+
"institution_id": bank,
|
64
|
+
"max_historical_days": max_historical_days,
|
65
|
+
"access_valid_for_days": access_valid_for_days,
|
66
|
+
"access_scope": decoder.decode(access_scope),
|
67
|
+
},
|
68
|
+
headers=build_header(token),
|
69
|
+
)
|
70
|
+
check_result(r1)
|
71
|
+
agreement_id = r1.json()["id"]
|
72
|
+
r2 = requests.post(
|
52
73
|
"https://bankaccountdata.gocardless.com/api/v2/requisitions/",
|
53
74
|
data={
|
54
75
|
"redirect": "http://localhost",
|
76
|
+
"agreement": agreement_id,
|
55
77
|
"institution_id": bank,
|
56
78
|
"reference": reference,
|
57
79
|
},
|
58
80
|
headers=build_header(token),
|
59
81
|
)
|
60
|
-
check_result(
|
61
|
-
link =
|
82
|
+
check_result(r2)
|
83
|
+
link = r2.json()["link"]
|
62
84
|
print(f"Go to {link} for connecting to your bank.") # noqa: T201
|
63
85
|
|
64
86
|
|
@@ -137,12 +159,27 @@ def parse_args(args: Any) -> Any:
|
|
137
159
|
parser.add_argument(
|
138
160
|
"--reference",
|
139
161
|
default="beancount",
|
140
|
-
help="reference for
|
162
|
+
help="reference for create_link and delete_link, needs to be unique",
|
141
163
|
)
|
142
164
|
parser.add_argument(
|
143
165
|
"--bank",
|
144
166
|
help="Bank to connect to, see list_banks",
|
145
167
|
)
|
168
|
+
parser.add_argument(
|
169
|
+
"--max_historical_days",
|
170
|
+
default="90",
|
171
|
+
help="the length of the transaction history to be retrieved",
|
172
|
+
)
|
173
|
+
parser.add_argument(
|
174
|
+
"--access_valid_for_days",
|
175
|
+
default="90",
|
176
|
+
help="the length of days while the access to account is valid, must be > 0 and <= 90",
|
177
|
+
)
|
178
|
+
parser.add_argument(
|
179
|
+
"--access_scope",
|
180
|
+
default='["balances", "details", "transactions"]',
|
181
|
+
help="the scope of information",
|
182
|
+
)
|
146
183
|
parser.add_argument(
|
147
184
|
"mode",
|
148
185
|
choices=[
|
@@ -163,7 +200,14 @@ def main(args: Any) -> None:
|
|
163
200
|
if args.mode == "list_banks":
|
164
201
|
list_bank(token, args.country)
|
165
202
|
elif args.mode == "create_link":
|
166
|
-
create_link(
|
203
|
+
create_link(
|
204
|
+
token,
|
205
|
+
args.reference,
|
206
|
+
args.bank,
|
207
|
+
args.max_historical_days,
|
208
|
+
args.access_valid_for_days,
|
209
|
+
args.access_scope,
|
210
|
+
)
|
167
211
|
elif args.mode == "list_accounts":
|
168
212
|
list_accounts(token)
|
169
213
|
elif args.mode == "delete_link":
|
@@ -20,8 +20,8 @@ tariochbctools/importers/neon/importer.py,sha256=kz8IEWXh8Sd8ysfKTQ49-rN5RgeD59p
|
|
20
20
|
tariochbctools/importers/netbenefits/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
21
|
tariochbctools/importers/netbenefits/importer.py,sha256=nzjz12uzi8ozYaOFW5S8U1LPToxk8C0jESL8X6Ex6CY,5904
|
22
22
|
tariochbctools/importers/nordigen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
-
tariochbctools/importers/nordigen/importer.py,sha256=
|
24
|
-
tariochbctools/importers/nordigen/nordigen_config.py,sha256=
|
23
|
+
tariochbctools/importers/nordigen/importer.py,sha256=lNAcuv-iDQfb82xVRi7--ApvCLCBLDGJLXX7awhDdvw,3953
|
24
|
+
tariochbctools/importers/nordigen/nordigen_config.py,sha256=GHSdyBpjbAscn-Kob0n4Xrp2L0yjc7vExshwt7O60hM,6468
|
25
25
|
tariochbctools/importers/postfinance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
tariochbctools/importers/postfinance/importer.py,sha256=PLBbnswb_tHt8wzd7yCC4UAWHoPn3WcJIXaOMewz6fc,2524
|
27
27
|
tariochbctools/importers/quickfile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -50,9 +50,9 @@ tariochbctools/plugins/check_portfolio_sum.py,sha256=naJ2j6BFpQhJhT2c-gfjyIdcYe0
|
|
50
50
|
tariochbctools/plugins/generate_base_ccy_prices.py,sha256=4CDzUosjMWCZfsBJMLrf-i5WNCHexI2rdm5vIDYW-AI,1314
|
51
51
|
tariochbctools/plugins/prices/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
52
|
tariochbctools/plugins/prices/ibkr.py,sha256=GYCjnlF-MK-ZFPEr0M6T4iO3Etq0tMmrMlsHGInXUO8,1405
|
53
|
-
tariochbctools-1.
|
54
|
-
tariochbctools-1.
|
55
|
-
tariochbctools-1.
|
56
|
-
tariochbctools-1.
|
57
|
-
tariochbctools-1.
|
58
|
-
tariochbctools-1.
|
53
|
+
tariochbctools-1.3.0.dist-info/licenses/LICENSE.txt,sha256=VR2hkz3p9Sw4hSXc7S5iZTOXGeV4h-i8AO_q0zEmtkE,1074
|
54
|
+
tariochbctools-1.3.0.dist-info/METADATA,sha256=qafViFxIs-0JxGrPrvw9iHUCxRKHch1hdh7G1IXXwpM,2190
|
55
|
+
tariochbctools-1.3.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
56
|
+
tariochbctools-1.3.0.dist-info/entry_points.txt,sha256=9xrCCY1wx2zCIsQUOWZelLHDmHw9Oc-ZBAKUIY9lKTA,88
|
57
|
+
tariochbctools-1.3.0.dist-info/top_level.txt,sha256=CiA_NepCI6zDNsaORA55zmpuJFSnTvLESraIL13xiOQ,15
|
58
|
+
tariochbctools-1.3.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|