-
Notifications
You must be signed in to change notification settings - Fork 49
/
account_report.py
34 lines (29 loc) · 976 Bytes
/
account_report.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
import logging
from datetime import date
from degiro_connector.trading.api import API as TradingAPI
from degiro_connector.trading.models.credentials import build_credentials
from degiro_connector.trading.models.account import Format, ReportRequest
logging.basicConfig(level=logging.DEBUG)
credentials = build_credentials(
location="config/config.json",
# override={
# "username": "TEXT_PLACEHOLDER",
# "password": "TEXT_PLACEHOLDER",
# "int_account": NUMBER_PLACEHOLDER, # From `get_client_details`
# # "totp_secret_key": "TEXT_PLACEHOLDER", # For 2FA
# },
)
trading_api = TradingAPI(credentials=credentials)
trading_api.connect()
# FETCH REPORT
report = trading_api.get_account_report(
report_request=ReportRequest(
country="FR",
lang="fr",
format=Format.CSV,
from_date=date(year=date.today().year - 1, month=1, day=1),
to_date=date.today(),
),
raw=False,
)
print(report)