File tree Expand file tree Collapse file tree
example/py_etp_client_example Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ETP_CONFIG_LIST_FILE_PATH = configs/all_server_configs.json
2+ ETP_CONFIG_ID = azure
3+
4+
5+
6+ # --------------------------------------- AZURE
7+ SERVER_AUTH_METHOD = azure_ad
8+ SERVER_NAME = azure
9+ SERVER_URL = wss://*****
10+ SERVER_TIMEOUT = 30
11+ SERVER_MAX_WEB_SOCKET_FRAME_PAYLOAD_SIZE = 500000000
12+ SERVER_MAX_WEB_SOCKET_MESSAGE_PAYLOAD_SIZE = 500000000
13+ SERVER_VERIFY_SSL = True
14+ SERVER_AUTO_RECONNECT = True
15+ SERVER_USE_TRANSACTIONS = True
16+ SERVER_TOKEN_EXPIRES_AT = 0.0
17+ SERVER_SUPPORTED_DATA_OBJECTS = []
18+ SERVER_SUPPORTED_PROTOCOLS = []
19+ SERVER_ADDITIONAL_HEADERS = {"data-partition-id": "opendes"}
20+ SERVER_ACL_OWNERS = ["data.default.owners@opendes.dataservices.energy"]
21+ SERVER_ACL_VIEWERS = ["data.default.viewers@opendes.dataservices.energy"]
22+ SERVER_LEGAL_TAGS = ["opendes-public-usa-dataset"]
23+ SERVER_DATA_COUNTRIES = ["US"]
24+ BASIC_TOKEN_EXPIRES_AT = 0.0
25+ OAUTH2_TOKEN_EXPIRES_AT = 0.0
26+ AZUREAD_TOKEN_EXPIRES_AT = 0.0
27+ AZUREAD_TENANT_ID = *****
28+ AZUREAD_CLIENT_ID = *****
29+ AZUREAD_CLIENT_SECRET = *****
30+ AZUREAD_SCOPE = *****/.default openid profile offline_access
31+ AWSCOGNITO_TOKEN_EXPIRES_AT = 0.0
32+ GCPO_TOKEN_EXPIRES_AT = 0.0
33+ BEARERTOKEN_TOKEN_EXPIRES_AT = 0.0
34+
35+ # --------------------------------------- AWS
36+
37+
38+ DEBUG = true
Original file line number Diff line number Diff line change 1010import numpy as np
1111
1212from py_etp_client .etpclient import ETPClient
13- from py_etp_client .etpconfig import ETPConfig
13+ from py_etp_client .etpconfig import ETPConfig , ServerConfig
1414from etpproto .client_info import ClientInfo
1515from etpproto .connection import ConnectionType
1616from etpproto .connection import (
3232from py_etp_client .etpclient import start_client
3333
3434
35- def main ():
35+ def main_deprecated ():
3636 config = ETPConfig ()
3737
3838 short_url = "." .join (config .URL .split ("." )[- 2 :]).split ("/" )[0 ] or "localhost"
@@ -77,5 +77,16 @@ def main():
7777 client .close ()
7878
7979
80+ def main ():
81+ config = ServerConfig .from_env ()
82+
83+ client = start_client (config )
84+ print ("Client started" )
85+
86+ print (client .get_dataspaces ())
87+
88+ client .close ()
89+
90+
8091if __name__ == "__main__" :
8192 main ()
You can’t perform that action at this time.
0 commit comments