-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathfavorite_create.py
More file actions
27 lines (22 loc) · 819 Bytes
/
favorite_create.py
File metadata and controls
27 lines (22 loc) · 819 Bytes
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
import logging
from degiro_connector.trading.api import API as TradingAPI
from degiro_connector.trading.models.credentials import build_credentials
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()
# CREATE A FAVORITE LIST
name = "SOME_LIST"
favorite_id = trading_api.create_favorite(name=name)
if favorite_id:
print(f"The following list was created : {name} = {favorite_id}.")
else:
print(f"Can't create this list : {name}.")