qe-api-client 2.0.0__py3-none-any.whl → 2.1.0__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.
- qe_api_client/api_classes/engine_app_api.py +4 -4
- qe_api_client/api_classes/engine_generic_object_api.py +25 -8
- qe_api_client/engine.py +90 -58
- qe_api_client/engine_helper.py +10 -10
- qe_api_client/structs.py +32 -55
- {qe_api_client-2.0.0.dist-info → qe_api_client-2.1.0.dist-info}/METADATA +1 -1
- {qe_api_client-2.0.0.dist-info → qe_api_client-2.1.0.dist-info}/RECORD +10 -10
- {qe_api_client-2.0.0.dist-info → qe_api_client-2.1.0.dist-info}/WHEEL +1 -1
- {qe_api_client-2.0.0.dist-info → qe_api_client-2.1.0.dist-info}/LICENSE +0 -0
- {qe_api_client-2.0.0.dist-info → qe_api_client-2.1.0.dist-info}/top_level.txt +0 -0
@@ -154,7 +154,7 @@ class EngineAppApi:
|
|
154
154
|
except KeyError:
|
155
155
|
return response['error']
|
156
156
|
|
157
|
-
def create_object(self, doc_handle,
|
157
|
+
def create_object(self, doc_handle, prop):
|
158
158
|
"""
|
159
159
|
Creates a new object in the app identified by the document handle.
|
160
160
|
|
@@ -169,7 +169,7 @@ class EngineAppApi:
|
|
169
169
|
dict: The created object (qReturn). In case of an error, returns the error information.
|
170
170
|
"""
|
171
171
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "method": "CreateObject", "handle": doc_handle,
|
172
|
-
"params":
|
172
|
+
"params": {"qProp": prop}})
|
173
173
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
174
174
|
try:
|
175
175
|
return response['result']['qReturn']
|
@@ -702,9 +702,9 @@ class EngineAppApi:
|
|
702
702
|
except KeyError:
|
703
703
|
return response['error']
|
704
704
|
|
705
|
-
def create_session_object(self, doc_handle,
|
705
|
+
def create_session_object(self, doc_handle, prop):
|
706
706
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CreateSessionObject",
|
707
|
-
"params":
|
707
|
+
"params": {"qProp": prop}})
|
708
708
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
709
709
|
try:
|
710
710
|
return response['result']['qReturn']
|
@@ -7,6 +7,7 @@ class EngineGenericObjectApi:
|
|
7
7
|
data visualization objects.
|
8
8
|
|
9
9
|
Methods:
|
10
|
+
create_child(handle, params): Creates a generic object that is a child of another generic object.
|
10
11
|
get_layout(handle): Retrieves the layout structure of a generic object.
|
11
12
|
get_full_property_tree(handle): Retrieves the full property tree of a generic object.
|
12
13
|
get_effective_properties(handle): Retrieves the effective properties of a generic object.
|
@@ -23,6 +24,23 @@ class EngineGenericObjectApi:
|
|
23
24
|
socket (object): The socket connection to the Qlik Sense engine.
|
24
25
|
"""
|
25
26
|
self.engine_socket = socket
|
27
|
+
def create_child(self, handle, params):
|
28
|
+
"""
|
29
|
+
Retrieves the layout structure of a specific generic object.
|
30
|
+
|
31
|
+
Parameters:
|
32
|
+
handle (int): The handle identifying the generic object.
|
33
|
+
params (str): The parameters of the generic object.
|
34
|
+
|
35
|
+
Returns:
|
36
|
+
dict: The layout structure of the generic object (qLayout). In case of an error, returns the error information.
|
37
|
+
"""
|
38
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "CreateChild", "params": [params]})
|
39
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
40
|
+
try:
|
41
|
+
return response["result"]
|
42
|
+
except KeyError:
|
43
|
+
return response["error"]
|
26
44
|
|
27
45
|
def get_layout(self, handle):
|
28
46
|
"""
|
@@ -76,7 +94,7 @@ class EngineGenericObjectApi:
|
|
76
94
|
except KeyError:
|
77
95
|
return response["error"]
|
78
96
|
|
79
|
-
def get_hypercube_data(self, handle, path="/qHyperCubeDef", pages=
|
97
|
+
def get_hypercube_data(self, handle, path="/qHyperCubeDef", pages={}):
|
80
98
|
"""
|
81
99
|
Retrieves the data from a specific hypercube in a generic object.
|
82
100
|
|
@@ -89,14 +107,14 @@ class EngineGenericObjectApi:
|
|
89
107
|
dict: The data from the hypercube. In case of an error, returns the error information.
|
90
108
|
"""
|
91
109
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubeData",
|
92
|
-
"params":
|
110
|
+
"params": {"qPath": path, "qPages": [pages]}})
|
93
111
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
94
112
|
try:
|
95
113
|
return response["result"]
|
96
114
|
except KeyError:
|
97
115
|
return response["error"]
|
98
116
|
|
99
|
-
def get_hypercube_pivot_data(self, handle, path="/qHyperCubeDef", pages=
|
117
|
+
def get_hypercube_pivot_data(self, handle, path="/qHyperCubeDef", pages={}):
|
100
118
|
"""
|
101
119
|
Retrieves the pivot data from a specific hypercube in a generic object.
|
102
120
|
|
@@ -108,16 +126,15 @@ class EngineGenericObjectApi:
|
|
108
126
|
Returns:
|
109
127
|
dict: The pivot data from the hypercube. In case of an error, returns the error information.
|
110
128
|
"""
|
111
|
-
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle,
|
112
|
-
"
|
113
|
-
"params": [path, pages]})
|
129
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubePivotData",
|
130
|
+
"params": {"qPath": path, "qPages": [pages]}})
|
114
131
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
115
132
|
try:
|
116
133
|
return response["result"]
|
117
134
|
except KeyError:
|
118
135
|
return response["error"]
|
119
136
|
|
120
|
-
def get_hypercube_stack_data(self, handle, path="/qHyperCubeDef", pages=
|
137
|
+
def get_hypercube_stack_data(self, handle, path="/qHyperCubeDef", pages={}, max_no_cells=10000):
|
121
138
|
"""
|
122
139
|
Retrieves the values of a stacked pivot table. It is possible to retrieve specific pages of data.
|
123
140
|
|
@@ -132,7 +149,7 @@ class EngineGenericObjectApi:
|
|
132
149
|
dict: The pivot data from the hypercube. In case of an error, returns the error information.
|
133
150
|
"""
|
134
151
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubeStackData",
|
135
|
-
"params":
|
152
|
+
"params": {"qPath": path, "qPages": [pages], "qMaxNbrCells": max_no_cells}})
|
136
153
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
137
154
|
try:
|
138
155
|
return response["result"]
|
qe_api_client/engine.py
CHANGED
@@ -49,50 +49,6 @@ class QixEngine:
|
|
49
49
|
self.app_handle = self.ega.get_handle(opened_app)
|
50
50
|
return opened_app['qGenericId']
|
51
51
|
|
52
|
-
def create_hypercube(self, doc_handle, list_of_dimensions=[], list_of_measures=[], rows_to_return=1000):
|
53
|
-
no_of_columns = len(list_of_dimensions) + len(list_of_measures)
|
54
|
-
hc_dim = []
|
55
|
-
for d in list_of_dimensions:
|
56
|
-
hc_inline_dim = self.structs.nx_inline_dimension_def([d])
|
57
|
-
hc_dim.append(self.structs.nx_hypercube_dimensions(hc_inline_dim))
|
58
|
-
hc_mes = []
|
59
|
-
for m in list_of_measures:
|
60
|
-
hc_mes_sort = self.structs.nx_sort_by()
|
61
|
-
hc_inline_mes = self.structs.nx_inline_measure_def(m)
|
62
|
-
hc_mes.append(self.structs.nx_hypercube_measure(hc_mes_sort, hc_inline_mes))
|
63
|
-
nx_page = self.structs.nx_page(0, 0, no_of_columns, rows_to_return)
|
64
|
-
hc_def = self.structs.hypercube_def("$", hc_dim, hc_mes, [nx_page])
|
65
|
-
hc_response = self.eaa.create_object(doc_handle, "CH01", "Chart", "qHyperCubeDef", hc_def)
|
66
|
-
hc_handle = self.ega.get_handle(hc_response)
|
67
|
-
# self.egoa.get_layout(hc_handle)
|
68
|
-
hc_data = self.egoa.get_hypercube_data(hc_handle, "/qHyperCubeDef", [nx_page])
|
69
|
-
no_of_columns = len(list_of_dimensions)+len(list_of_measures)
|
70
|
-
return hc_data, no_of_columns
|
71
|
-
|
72
|
-
@staticmethod
|
73
|
-
def convert_hypercube_to_matrix(hc_data, no_of_columns):
|
74
|
-
rows = hc_data["qDataPages"][0]['qMatrix']
|
75
|
-
matrix = [[0 for x in range(no_of_columns)] for y in range(len(rows))]
|
76
|
-
for col_idx, row in enumerate(rows):
|
77
|
-
for cell_idx, cell_val in enumerate(row):
|
78
|
-
matrix[col_idx][cell_idx] = cell_val['qText']
|
79
|
-
return [list(i) for i in zip(*matrix)]
|
80
|
-
|
81
|
-
@staticmethod
|
82
|
-
def convert_hypercube_to_inline_table(hc_data, table_name):
|
83
|
-
rows = hc_data["qDataPages"][0]['qMatrix']
|
84
|
-
script = str.format('{0}:{1}Load * Inline [{1}', table_name, '\n')
|
85
|
-
inline_rows = ''
|
86
|
-
header_row = ''
|
87
|
-
for col_idx in range(len(rows[0])):
|
88
|
-
header_row = header_row + str.format('Column{0}{1}', col_idx, ',')
|
89
|
-
header_row = header_row[:-1] + '\n'
|
90
|
-
for row in rows:
|
91
|
-
for cell_val in row:
|
92
|
-
inline_rows = inline_rows + "'" + cell_val['qText'] + "'" + ','
|
93
|
-
inline_rows = inline_rows[:-1] + '\n'
|
94
|
-
return script + header_row + inline_rows + '];'
|
95
|
-
|
96
52
|
def select_in_dimension(self, dimension_name, list_of_values):
|
97
53
|
lb_field = self.eaa.get_field(self.app_handle, dimension_name)
|
98
54
|
fld_handle = self.ega.get_handle(lb_field)
|
@@ -163,23 +119,19 @@ class QixEngine:
|
|
163
119
|
except ValueError:
|
164
120
|
return "Bad handle value in " + obj
|
165
121
|
|
166
|
-
def get_chart_data(self,
|
122
|
+
def get_chart_data(self, app_handle, obj_id):
|
167
123
|
"""
|
168
124
|
Retrieves the data from a given chart object.
|
169
125
|
|
170
126
|
Parameters:
|
171
|
-
|
127
|
+
app_handle (int): The handle of the app.
|
172
128
|
obj_id (str): The ID of the chart object.
|
173
129
|
|
174
130
|
Returns:
|
175
|
-
|
176
|
-
|
177
|
-
Raises:
|
178
|
-
ValueError: If the handle value is invalid.
|
131
|
+
DataFrame: A table of the chart content.
|
179
132
|
"""
|
180
|
-
|
181
133
|
# Get object ID
|
182
|
-
obj = self.eaa.get_object(
|
134
|
+
obj = self.eaa.get_object(app_handle, obj_id)
|
183
135
|
if obj['qType'] is None:
|
184
136
|
return 'Chart ID does not exists!'
|
185
137
|
|
@@ -212,7 +164,7 @@ class QixEngine:
|
|
212
164
|
# Retrieves the hypercube data in a loop (because of limitation from 10.000 cells per call)
|
213
165
|
while no_of_rows > page * height:
|
214
166
|
nx_page = self.structs.nx_page(0, page * height, width, height)
|
215
|
-
hc_data = self.egoa.get_hypercube_data(obj_handle, '/qHyperCubeDef',
|
167
|
+
hc_data = self.egoa.get_hypercube_data(obj_handle, '/qHyperCubeDef', nx_page)[
|
216
168
|
'qDataPages'][0]['qMatrix']
|
217
169
|
data_values.extend(hc_data)
|
218
170
|
page += 1
|
@@ -242,7 +194,7 @@ class QixEngine:
|
|
242
194
|
# Gets the column headers for the pivot table
|
243
195
|
col_headers = []
|
244
196
|
nx_page_top = self.structs.nx_page(0, 0, width, 1)
|
245
|
-
hc_top = self.egoa.get_hypercube_pivot_data(obj_handle, '/qHyperCubeDef',
|
197
|
+
hc_top = self.egoa.get_hypercube_pivot_data(obj_handle, '/qHyperCubeDef', nx_page_top)[
|
246
198
|
'qDataPages'][0]['qTop']
|
247
199
|
for top_node in hc_top:
|
248
200
|
col_headers.extend(get_all_dimensions(top_node))
|
@@ -257,13 +209,13 @@ class QixEngine:
|
|
257
209
|
nx_page = self.structs.nx_page(0, page * height, width, height)
|
258
210
|
|
259
211
|
# Retrieves the row headers for the pivot table
|
260
|
-
hc_left = self.egoa.get_hypercube_pivot_data(obj_handle, '/qHyperCubeDef',
|
212
|
+
hc_left = self.egoa.get_hypercube_pivot_data(obj_handle, '/qHyperCubeDef', nx_page)[
|
261
213
|
'qDataPages'][0]['qLeft']
|
262
214
|
for left_node in hc_left:
|
263
215
|
row_headers.extend(get_all_dimensions(left_node))
|
264
216
|
|
265
217
|
# Retrieves the data for the pivot table
|
266
|
-
hc_data = self.egoa.get_hypercube_pivot_data(obj_handle, '/qHyperCubeDef',
|
218
|
+
hc_data = self.egoa.get_hypercube_pivot_data(obj_handle, '/qHyperCubeDef', nx_page)[
|
267
219
|
'qDataPages'][0]['qData']
|
268
220
|
for row in hc_data:
|
269
221
|
data_values.append([cell['qText'] for cell in row])
|
@@ -281,8 +233,8 @@ class QixEngine:
|
|
281
233
|
elif obj_layout['qInfo']['qType'] in ['barchart'] and obj_layout['qHyperCube']['qStackedDataPages'] != []:
|
282
234
|
max_no_cells = no_of_columns * no_of_rows
|
283
235
|
nx_page = self.structs.nx_page(0, 0, no_of_columns, no_of_rows)
|
284
|
-
hc_data = self.egoa.get_hypercube_stack_data(obj_handle, '/qHyperCubeDef',
|
285
|
-
|
236
|
+
hc_data = self.egoa.get_hypercube_stack_data(obj_handle, '/qHyperCubeDef', nx_page, max_no_cells)[
|
237
|
+
'qDataPages'][0]['qData'][0]['qSubNodes']
|
286
238
|
|
287
239
|
# Transform the nested structure into a flat DataFrame
|
288
240
|
data_values = []
|
@@ -297,5 +249,85 @@ class QixEngine:
|
|
297
249
|
else:
|
298
250
|
return 'Chart type not supported.'
|
299
251
|
|
252
|
+
# Returns the Dataframe
|
253
|
+
return df
|
254
|
+
|
255
|
+
def get_constructed_table_data(self, app_handle, list_of_dimensions = [], list_of_measures = [],
|
256
|
+
list_of_master_dimensions = [], list_of_master_measures = []):
|
257
|
+
"""
|
258
|
+
Creates a table from given fields, expressions, dimensions or measures and retrieves the data from it.
|
259
|
+
|
260
|
+
Parameters:
|
261
|
+
app_handle (int): The handle of the app.
|
262
|
+
list_of_dimensions (list): A list of dimensions.
|
263
|
+
list_of_measures (list): A list of measures.
|
264
|
+
list_of_master_dimensions (list): A list of master dimensions.
|
265
|
+
list_of_master_measures (list): A list of master measures.
|
266
|
+
|
267
|
+
Returns:
|
268
|
+
DataFrame: A table of the chart content.
|
269
|
+
"""
|
270
|
+
# Create dimension property
|
271
|
+
hc_dim = []
|
272
|
+
for dimension in list_of_dimensions:
|
273
|
+
hc_inline_dim_def = self.structs.nx_inline_dimension_def([dimension])
|
274
|
+
hc_dim.append(self.structs.nx_dimension("", hc_inline_dim_def))
|
275
|
+
for dimension in list_of_master_dimensions:
|
276
|
+
hc_dim.append(self.structs.nx_dimension(dimension))
|
277
|
+
|
278
|
+
# Create measure property
|
279
|
+
hc_mes = []
|
280
|
+
for measure in list_of_measures:
|
281
|
+
hc_inline_mes = self.structs.nx_inline_measure_def(measure)
|
282
|
+
hc_mes.append(self.structs.nx_measure("", hc_inline_mes))
|
283
|
+
for measure in list_of_master_measures:
|
284
|
+
hc_mes.append(self.structs.nx_measure(measure))
|
285
|
+
|
286
|
+
# Create hypercube structure
|
287
|
+
hc_def = self.structs.hypercube_def("$", hc_dim, hc_mes)
|
288
|
+
|
289
|
+
# Create info structure
|
290
|
+
nx_info = self.structs.nx_info("table")
|
291
|
+
|
292
|
+
# Create generic object properties structure
|
293
|
+
gen_obj_props = self.structs.generic_object_properties(nx_info, "qHyperCubeDef", hc_def)
|
294
|
+
|
295
|
+
# Create session object
|
296
|
+
hc_obj = self.eaa.create_session_object(app_handle, gen_obj_props)
|
297
|
+
|
298
|
+
# Get object handle
|
299
|
+
hc_obj_handle = self.get_handle(hc_obj)
|
300
|
+
|
301
|
+
# Get object layout
|
302
|
+
hc_obj_layout = self.egoa.get_layout(hc_obj_handle)
|
303
|
+
|
304
|
+
# Determine the number of the columns and the rows the table has and splits in certain circumstances the table calls
|
305
|
+
no_of_columns = hc_obj_layout['qHyperCube']['qSize']['qcx']
|
306
|
+
width = no_of_columns
|
307
|
+
no_of_rows = hc_obj_layout['qHyperCube']['qSize']['qcy']
|
308
|
+
height = int(math.floor(10000 / no_of_columns))
|
309
|
+
|
310
|
+
# Extract the dimension and measure titles and concat them to column names.
|
311
|
+
dimension_titles = [dim['qFallbackTitle'] for dim in hc_obj_layout['qHyperCube']['qDimensionInfo']]
|
312
|
+
measure_titles = [measure['qFallbackTitle'] for measure in hc_obj_layout['qHyperCube']['qMeasureInfo']]
|
313
|
+
column_names = dimension_titles + measure_titles
|
314
|
+
|
315
|
+
# Paging variables
|
316
|
+
page = 0
|
317
|
+
data_values = []
|
318
|
+
|
319
|
+
# Retrieves the hypercube data in a loop (because of limitation from 10.000 cells per call)
|
320
|
+
while no_of_rows > page * height:
|
321
|
+
nx_page = self.structs.nx_page(0, page * height, width, height)
|
322
|
+
hc_data = self.egoa.get_hypercube_data(hc_obj_handle, '/qHyperCubeDef', nx_page)['qDataPages'][0]['qMatrix']
|
323
|
+
data_values.extend(hc_data)
|
324
|
+
page += 1
|
325
|
+
|
326
|
+
# Creates Dataframe from the content of the attribute 'qText'.
|
327
|
+
df = pd.DataFrame([[d['qText'] for d in sublist] for sublist in data_values])
|
328
|
+
|
329
|
+
# Assign titles zu Dataframe columns
|
330
|
+
df.columns = column_names
|
331
|
+
|
300
332
|
# Returns the Dataframe
|
301
333
|
return df
|
qe_api_client/engine_helper.py
CHANGED
@@ -4,7 +4,7 @@ from qe_api_client.api_classes.engine_app_api import EngineAppApi
|
|
4
4
|
from qe_api_client.api_classes.engine_field_api import EngineFieldApi
|
5
5
|
from qe_api_client.api_classes.engine_generic_object_api import EngineGenericObjectApi
|
6
6
|
from qe_api_client.api_classes.engine_global_api import EngineGlobalApi
|
7
|
-
|
7
|
+
import qe_api_client.structs as structs
|
8
8
|
|
9
9
|
import pandas as pd
|
10
10
|
|
@@ -12,22 +12,22 @@ import pandas as pd
|
|
12
12
|
def getDataFrame(connection, appHandle, measures, dimensions, selections={}):
|
13
13
|
engineGlobalApi = EngineGlobalApi(connection)
|
14
14
|
# Define Dimensions of hypercube
|
15
|
-
hc_inline_dim =
|
15
|
+
hc_inline_dim = structs.nx_inline_dimension_def(dimensions)
|
16
16
|
|
17
17
|
# Set sorting of Dimension by Measure
|
18
|
-
hc_mes_sort =
|
18
|
+
hc_mes_sort = structs.sort_criteria()
|
19
19
|
|
20
20
|
# Define Measure of hypercube
|
21
|
-
hc_inline_mes =
|
21
|
+
hc_inline_mes = structs.nx_inline_measure_def(measures)
|
22
22
|
|
23
23
|
# Build hypercube from above definition
|
24
|
-
hc_dim =
|
25
|
-
hc_mes =
|
24
|
+
hc_dim = structs.nx_dimension(hc_inline_dim)
|
25
|
+
hc_mes = structs.nx_measure("", hc_inline_mes, hc_mes_sort)
|
26
26
|
|
27
27
|
width = len(measures) + len(dimensions)
|
28
28
|
height = int(math.floor(10000 / width))
|
29
|
-
nx_page =
|
30
|
-
hc_def =
|
29
|
+
nx_page = structs.nx_page(0, 0, width, height)
|
30
|
+
hc_def = structs.hypercube_def("$", [hc_dim], [hc_mes], [nx_page])
|
31
31
|
|
32
32
|
engineAppApi = EngineAppApi(connection)
|
33
33
|
hc_response = engineAppApi.create_object(appHandle, "CH01", "Chart", "qHyperCubeDef", hc_def) # NOQA
|
@@ -47,8 +47,8 @@ def getDataFrame(connection, appHandle, measures, dimensions, selections={}):
|
|
47
47
|
|
48
48
|
i = 0
|
49
49
|
while i % height == 0:
|
50
|
-
nx_page =
|
51
|
-
hc_data = engineGenericObjectApi.get_hypercube_data(hc_handle, "/qHyperCubeDef",
|
50
|
+
nx_page = structs.nx_page(0, i, width, height)
|
51
|
+
hc_data = engineGenericObjectApi.get_hypercube_data(hc_handle, "/qHyperCubeDef", nx_page) # NOQA
|
52
52
|
elems = hc_data["qDataPages"][0]['qMatrix']
|
53
53
|
|
54
54
|
df = pd.DataFrame()
|
qe_api_client/structs.py
CHANGED
@@ -12,70 +12,47 @@ def list_object_def(state_name="$", library_id="", field_defs=None, field_labels
|
|
12
12
|
"qDef": {"qFieldDefs": field_defs, "qFieldLabels": field_labels, "qSortCriterias": sort_criterias},
|
13
13
|
"qInitialDataFetch": initial_data_fetch}
|
14
14
|
|
15
|
-
|
16
15
|
def hypercube_def(state_name="$", nx_dims=[], nx_meas=[], nx_page=[], inter_column_sort=[0, 1, 2], suppress_zero=False,
|
17
16
|
suppress_missing=False):
|
18
|
-
return {"qStateName": state_name,
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"qSuppressMissing": suppress_missing,
|
24
|
-
"qInitialDataFetch": nx_page, # NxPage
|
25
|
-
"qMode": 'S',
|
26
|
-
"qNoOfLeftDims": -1,
|
27
|
-
"qAlwaysFullyExpanded": False,
|
28
|
-
"qMaxStackedCells": 5000,
|
29
|
-
"qPopulateMissing": False,
|
30
|
-
"qShowTotalsAbove": False,
|
31
|
-
"qIndentMode": False,
|
32
|
-
"qCalcCond": "",
|
33
|
-
"qSortbyYValue": 0
|
34
|
-
}
|
35
|
-
|
17
|
+
return {"qStateName": state_name, "qDimensions": nx_dims, "qMeasures": nx_meas,
|
18
|
+
"qInterColumnSortOrder": inter_column_sort, "qSuppressZero": suppress_zero,
|
19
|
+
"qSuppressMissing": suppress_missing, "qInitialDataFetch": nx_page, "qMode": 'S', "qNoOfLeftDims": -1,
|
20
|
+
"qAlwaysFullyExpanded": False, "qMaxStackedCells": 5000, "qPopulateMissing": False,
|
21
|
+
"qShowTotalsAbove": False, "qIndentMode": False, "qCalcCond": "", "qSortbyYValue": 0}
|
36
22
|
|
37
|
-
def
|
38
|
-
return {"
|
23
|
+
def nx_inline_dimension_def(field_definitions=[], field_labels=[], sort_criterias=[], grouping='N'):
|
24
|
+
return {"qGrouping": grouping, "qFieldDefs": field_definitions, "qFieldLabels": field_labels,
|
25
|
+
"qSortCriterias": sort_criterias, "qReverseSort": False}
|
39
26
|
|
27
|
+
def nx_inline_measure_def(definition, label="", description="", tags=[], grouping="N"):
|
28
|
+
return {"qLabel": label, "qDescription": description, "qTags": tags, "qGrouping": grouping, "qDef": definition}
|
40
29
|
|
41
|
-
def
|
42
|
-
return {"
|
43
|
-
"qFieldDefs": field_definitions,
|
44
|
-
"qFieldLabels": field_labels
|
45
|
-
}
|
46
|
-
|
30
|
+
def nx_page(left=0, top=0, width=2, height=2):
|
31
|
+
return {"qLeft": left, "qTop": top, "qWidth": width, "qHeight": height}
|
47
32
|
|
48
|
-
def
|
49
|
-
|
50
|
-
|
51
|
-
}
|
33
|
+
def nx_info(obj_type, obj_id=""):
|
34
|
+
"""
|
35
|
+
Retrieves the data from a specific list object in a generic object.
|
52
36
|
|
37
|
+
Parameters:
|
38
|
+
obj_type (str): Type of the object. This parameter is mandatory.
|
39
|
+
obj_id (str): Identifier of the object. If the chosen identifier is already in use, the engine automatically
|
40
|
+
sets another one. If an identifier is not set, the engine automatically sets one. This parameter is optional.
|
53
41
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
"qSortByAscii": ascii,
|
59
|
-
"qSortByLoadOrder": load_order,
|
60
|
-
"qSortByExpression": 0,
|
61
|
-
"qExpression": {
|
62
|
-
"qv": ""
|
63
|
-
}
|
64
|
-
}
|
42
|
+
Returns:
|
43
|
+
dict: Struct "nxInfo"
|
44
|
+
"""
|
45
|
+
return {"qId": obj_id, "qType": obj_type}
|
65
46
|
|
47
|
+
def nx_dimension(library_id="", dim_def={}, null_suppression=False):
|
48
|
+
return {"qLibraryId": library_id, "qDef": dim_def, "qNullSuppression": null_suppression}
|
66
49
|
|
67
|
-
def
|
68
|
-
|
69
|
-
tags=[],
|
70
|
-
grouping="N"
|
71
|
-
):
|
72
|
-
return {"qLabel": label,
|
73
|
-
"qDescription": description,
|
74
|
-
"qTags": tags,
|
75
|
-
"qGrouping": grouping,
|
76
|
-
"qDef": definition
|
77
|
-
}
|
50
|
+
def nx_measure(library_id="", mes_def={}, sort_by={}):
|
51
|
+
return {"qLibraryId": library_id, "qDef": mes_def, "qSortBy": sort_by}
|
78
52
|
|
53
|
+
def generic_object_properties(info, prop_name, prop_def, extends_id="", state_name="$"):
|
54
|
+
return {"qInfo": info, "qExtendsId": extends_id, prop_name: prop_def, "qStateName": state_name}
|
79
55
|
|
80
|
-
def
|
81
|
-
return {"
|
56
|
+
def sort_criteria(state=0, freq=0, numeric=0, ascii=0, load_order=1):
|
57
|
+
return {"qSortByState": state, "qSortByFrequency": freq, "qSortByNumeric": numeric, "qSortByAscii": ascii,
|
58
|
+
"qSortByLoadOrder": load_order, "qSortByExpression": 0, "qExpression": {"qv": ""}}
|
@@ -1,18 +1,18 @@
|
|
1
1
|
qe_api_client/__init__.py,sha256=bypB4CIjpHtf5Pu_NwtJajC69zqQD7qB9jo8cCX0B54,23
|
2
|
-
qe_api_client/engine.py,sha256=
|
2
|
+
qe_api_client/engine.py,sha256=3x1bP79kdEIuvXpY3PE0MAMx9E9bKkMDOxQrPNIiWAk,14746
|
3
3
|
qe_api_client/engine_communicator.py,sha256=Va8Kz4cN6uyKLzV3JllBw08KbU4uDn8e-5pIm5Kmsfs,1291
|
4
|
-
qe_api_client/engine_helper.py,sha256=
|
5
|
-
qe_api_client/structs.py,sha256=
|
4
|
+
qe_api_client/engine_helper.py,sha256=DSZR92-pGqklzki53QufgGr9tUTKKXZyF_fHEfXokTs,2382
|
5
|
+
qe_api_client/structs.py,sha256=yNca4rQjc_AfchsEso047JvBBpLZqRPIiS-SbxXcNfs,3157
|
6
6
|
qe_api_client/api_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
qe_api_client/api_classes/engine_app_api.py,sha256=
|
7
|
+
qe_api_client/api_classes/engine_app_api.py,sha256=6SK-aE6gHgrNvd_VunCvdh1HHe1y2wYo3NO9KhCPXd8,38306
|
8
8
|
qe_api_client/api_classes/engine_field_api.py,sha256=KiFhs2ev3S-92JklWzIVtfTEZ1oCiHEAanm1AXtV38s,4407
|
9
9
|
qe_api_client/api_classes/engine_generic_dimension_api.py,sha256=1joTET6GWCTW-80wafrajLQuMyFwIPp0QKoILyLdP1U,1377
|
10
10
|
qe_api_client/api_classes/engine_generic_measure_api.py,sha256=zbRYRA99LQS9SY3QVgoUABqgVDRPwBQ8o2ZbESVEsHE,1321
|
11
|
-
qe_api_client/api_classes/engine_generic_object_api.py,sha256=
|
11
|
+
qe_api_client/api_classes/engine_generic_object_api.py,sha256=nqsEtvKkt5XkUEIVUoBtNVXtmUvuifxrgTcw2fDuaOE,8218
|
12
12
|
qe_api_client/api_classes/engine_generic_variable_api.py,sha256=sWXZpE-GLfcMijmfORnDNrJ6lmXX3x5TRHlkEu_i0BQ,2027
|
13
13
|
qe_api_client/api_classes/engine_global_api.py,sha256=SdzhIP6Isco83xB1Y6y3LHKv-HjBTS_iMh-QdVYAl4g,27499
|
14
|
-
qe_api_client-2.
|
15
|
-
qe_api_client-2.
|
16
|
-
qe_api_client-2.
|
17
|
-
qe_api_client-2.
|
18
|
-
qe_api_client-2.
|
14
|
+
qe_api_client-2.1.0.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
|
15
|
+
qe_api_client-2.1.0.dist-info/METADATA,sha256=p4TqYcNoSN8CR6IHV9ITawbNwOnD-LWZi6756JLDoWU,1995
|
16
|
+
qe_api_client-2.1.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
17
|
+
qe_api_client-2.1.0.dist-info/top_level.txt,sha256=m_43YagP8UtZgJHmZEfu0vlBNwt36M01-Qby2jByMnk,14
|
18
|
+
qe_api_client-2.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|