ep-sdk-4pd 1.0.0__tar.gz → 1.0.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ep_sdk_4pd
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: 4paradigm Electricity Platform Service SDK Library for Python
5
5
  Home-page: https://gitlab.4pd.io/electricityproject/electricity-platform-sdk
6
6
  Author: 4paradigm Electricity Platform SDK
@@ -0,0 +1 @@
1
+ __version__ = '1.0.2'
@@ -10,16 +10,21 @@ from ep_sdk_4pd.models import HistoryDataRequest, PredictDataRequest
10
10
  # test 地址
11
11
  # endpoint = 'http://172.27.88.56:6001'
12
12
 
13
-
14
13
  # prod 地址
15
- endpoint = 'http://172.27.88.56:6601'
14
+ # endpoint = 'http://172.27.88.56:6601'
15
+
16
+ # 外网 地址
17
+ endpoint = 'http://82.157.231.254:6001'
18
+
19
+ Authorization = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlbGVjdHJpY2l0eS1wbGF0Zm9ybSIsInN1YiI6IjEyMyIsImlhdCI6MTc0NjYwNjQ4NSwianRpIjoiMTIzXzE3NDY1Nzc2ODUxNDYiLCJ0eXBlIjoiYWNjZXNzIn0.Clrz_8j3aJlXTWPX-4DS0NxXN9idTcUIc0AtXOMIjd8'
20
+
16
21
 
17
22
  class EpData:
18
23
 
19
24
  @staticmethod
20
25
  def get_history_data(
21
- scope = None,
22
- days = 0
26
+ scope=None,
27
+ days=0
23
28
  ):
24
29
  # 最晚时间为系统时间 D-2
25
30
  date_str = EpSystem.get_system_date(is_online=True)
@@ -46,6 +51,7 @@ class EpData:
46
51
  full_url = f'{endpoint}{request.api}'
47
52
  headers = {
48
53
  'content-type': request.content_type,
54
+ 'Authorization': Authorization
49
55
  }
50
56
 
51
57
  payload = {
@@ -80,7 +86,7 @@ class EpData:
80
86
 
81
87
  # 测试
82
88
  if is_test:
83
- system_date=test_time
89
+ system_date = test_time
84
90
 
85
91
  request = PredictDataRequest(
86
92
  scope=scope,
@@ -101,6 +107,7 @@ class EpData:
101
107
  full_url = f'{endpoint}{request.api}'
102
108
  headers = {
103
109
  'content-type': request.content_type,
110
+ 'Authorization': Authorization
104
111
  }
105
112
 
106
113
  payload = {
@@ -120,4 +127,4 @@ class EpData:
120
127
  data=response.json().get('data', None),
121
128
  message=response.json().get('message', None),
122
129
  )
123
- return ep_sdk_4pd_models.PredictDataResponse(response=base_resp)
130
+ return ep_sdk_4pd_models.PredictDataResponse(response=base_resp)
@@ -12,9 +12,14 @@ from ep_sdk_4pd.models import ModelOutputDirRequest, RunStrategyRequest, CallTra
12
12
  # test 地址
13
13
  # endpoint = 'http://172.27.88.56:6001'
14
14
 
15
-
16
15
  # prod 地址
17
- endpoint = 'http://172.27.88.56:6601'
16
+ # endpoint = 'http://172.27.88.56:6601'
17
+
18
+ # 外网 地址
19
+ endpoint = 'http://82.157.231.254:6001'
20
+
21
+ Authorization = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlbGVjdHJpY2l0eS1wbGF0Zm9ybSIsInN1YiI6IjEyMyIsImlhdCI6MTc0NjYwNjQ4NSwianRpIjoiMTIzXzE3NDY1Nzc2ODUxNDYiLCJ0eXBlIjoiYWNjZXNzIn0.Clrz_8j3aJlXTWPX-4DS0NxXN9idTcUIc0AtXOMIjd8'
22
+
18
23
 
19
24
  class EpSystem:
20
25
 
@@ -34,6 +39,7 @@ class EpSystem:
34
39
  full_url = f'{endpoint}{request.api}'
35
40
  headers = {
36
41
  'content-type': request.content_type,
42
+ 'Authorization': Authorization
37
43
  }
38
44
 
39
45
  payload = {
@@ -95,6 +101,7 @@ class EpSystem:
95
101
  full_url = f'{endpoint}{request.api}'
96
102
  headers = {
97
103
  'content-type': request.content_type,
104
+ 'Authorization': Authorization
98
105
  }
99
106
 
100
107
  payload = {
@@ -134,6 +141,7 @@ class EpSystem:
134
141
  full_url = f'{endpoint}{request.api}'
135
142
  headers = {
136
143
  'content-type': request.content_type,
144
+ 'Authorization': Authorization
137
145
  }
138
146
 
139
147
  payload = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ep_sdk_4pd
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: 4paradigm Electricity Platform Service SDK Library for Python
5
5
  Home-page: https://gitlab.4pd.io/electricityproject/electricity-platform-sdk
6
6
  Author: 4paradigm Electricity Platform SDK
@@ -8,7 +8,7 @@ DESCRIPTION = '4paradigm Electricity Platform Service SDK Library for Python'
8
8
  AUTHOR = '4paradigm Electricity Platform SDK'
9
9
  AUTHOR_EMAIL = ''
10
10
  URL = 'https://gitlab.4pd.io/electricityproject/electricity-platform-sdk'
11
- VERSION = '1.0.0'
11
+ VERSION = '1.0.2'
12
12
  REQUIRES = ['requests']
13
13
 
14
14
  LONG_DESCRIPTION = ''
@@ -1 +0,0 @@
1
- __version__ = '1.0.0'
File without changes
File without changes