Engine API Module
- class qe_api_client.engine.QixEngine(url, user_directory=None, user_id=None, ca_certs=None, certfile=None, keyfile=None, app_id=None)[source]
Bases:
object
The class of the client to interact with the Qlik Sense Engine API.
- select_in_dimension(app_handle, dimension_name, list_of_values)
Selects values in a given field.
- create_chart(handle: int, obj_type: str, hypercube_def: dict, no_of_rows_sheet: int, col: int, row: int, colspan: int, rowspan: int)[source]
Creates a chart object.
- Parameters:
handle (int) – The handle of the parent object.
obj_type (str) – The type of the chart.
hypercube_def (dict) – Chart hypercube definition.
no_of_rows_sheet (int) – The number of the sheet rows.
col (int) – First column the chart visualisation starts.
row (int) – First row the chart visualisation starts.
colspan (int) – The width of the chart in columns.
rowspan (int) – The height of the chart in rows.
- Returns:
The handle and Id of the filterpane frame.
- Return type:
dict
- create_filterpane_frame(handle: int, no_of_rows_sheet: int, col: int, row: int, colspan: int, rowspan: int)[source]
Creates a filterpane frame.
- Parameters:
handle (int) – The handle of the parent object.
no_of_rows_sheet (int) – The number of the sheet rows.
col (int) – First column the filterpane visualisation starts.
row (int) – First row the filterpane visualisation starts.
colspan (int) – The width of the filterpane in columns.
rowspan (int) – The height of the filterpane in rows.
- Returns:
The handle and Id of the filterpane frame.
- Return type:
dict
- create_list_object(handle: int, dim_id: str = '', field_def: str = '', field_title: str = '')[source]
Creates a list object.
- Parameters:
handle (int) – The handle of the parent object.
dim_id (str, optional) – The ID of the master dimension. Let this parameter empty, if you passed the “field_def”.
field_def (str, optional) – The definition of the field. Let this parameter empty, if you passed the “dim_id”.
field_title (int, optional) – The title of the field. Let this parameter empty, if you passed the “dim_id”.
- Returns:
The handle and Id of the list object.
- Return type:
dict
- create_master_measure(app_handle: int, mes_title: str, mes_def: str, mes_label: str = '', mes_desc: str = '', mes_tags: list = None, mes_color: str = None, mes_color_index: int = -1, gradient: dict = None)[source]
Creates a master measure.
- Parameters:
app_handle (int) – The handle of the app.
mes_title (str) – The title of the measure.
mes_def (str) – The definition of the measure.
mes_label (str, optional) – The label of the measure.
mes_desc (str, optional) – The description of the measure.
mes_tags (list, optional) – The tags of the measure.
mes_color (str, optional) – The color of the measure.
mes_color_index (int, optional) – The index of the color of the measure.
- Returns:
The handle and Id of the measure.
- Return type:
dict
- create_sheet(app_handle: int, sheet_title: str, sheet_desc: str = '', no_of_rows: int = 18)[source]
Creates a sheet.
- Parameters:
app_handle (int) – The handle of the app.
sheet_title (str) – The title of the sheet.
sheet_desc (str, optional) – The description of the sheet.
no_of_rows (int, optional) – TThe number of the sheet rows. Min. 8 rows and max. 42 rows.
- Returns:
The handle and Id of the sheet.
- Return type:
dict
- create_single_master_dimension(app_handle: int, dim_title: str, dim_def: str, dim_label: str = '', dim_desc: str = '', dim_tags: list = None, dim_color: str = None, dim_color_index: int = -1, value_colors: list = None, null_value_color: str = None, null_value_color_index: int = -1, other_value_color: str = None, other_value_color_index: int = -1, single_color: str = None, single_color_index: int = -1, palette: str = None)[source]
Creates a single master dimension.
- Parameters:
app_handle (int) – The handle of the app.
dim_title (str) – The title of the dimension.
dim_def (str) – The definition of the dimension.
dim_label (str, optional) – The label of the dimension.
dim_desc (str, optional) – The description of the dimension.
dim_tags (list, optional) – The tags of the dimension.
dim_color (str, optional) – The master dimension color.
dim_color_index (int, optional) – The index of the master dimension color in the theme color picker.
value_colors (list, optional) – The value colors of the master dimension.
null_value_color (str, optional) – The NULL value color of the master dimension.
null_value_color_index (int, optional) – The index of the NULL value color of the master dimension in the theme color picker.
other_value_color (str, optional) – The OTHER value color of the master dimension.
other_value_color_index (int, optional) – The index of the OTHER value color of the master dimension in the theme color picker.
single_color (str, optional) – Single color of the values of the master dimension.
single_color_index (int, optional) – The index of single color of the values of the master dimension in the theme color picker.
palette (str, optional) – Choose a color palette, if there are more than one.
- Returns:
The handle and Id of the dimension.
- Return type:
dict
- create_snapshot(app_handle: int, object_id: str, snapshot_title: str = '', snapshot_description: str = '', show_titles: bool = True, object_width: float = 1280, object_height: float = 720, bounding_client_width: float = 1280, bounding_client_height: float = 720, rtl: bool = False, parent_width: float = 1280, parent_height: float = 720, content_width: float = 1280, content_height: float = 720, chart_data_scroll_offset_start: int = 0, chart_data_scroll_offset_end: int = 53, chart_data_legend_scroll_offset: int = 0, chart_data_zoom_min=0, chart_data_zoom_max=0)[source]
Creates a snapshot object.
- Parameters:
app_handle (int) – The handle of the app.
object_id (str) – The id of the object.
snapshot_title (str) – The title of the snapshot.
snapshot_description (str) – The description of the snapshot.
show_titles (bool) – Enables / disables chart title.
object_width (float) – The width of the snapshot object.
object_height (float) – The height of the snapshot object.
bounding_client_width (float) – The width of the bounding client.
bounding_client_height (float) – The height of the bounding client.
rtl (bool) – Controls the rendering of content with right-to-left (RTL) language support.
parent_width (float) – The width of the parent object.
parent_height (float) – The height of the parent object.
content_width (float) – The width of the content object.
content_height (float) – The height of the content object.
chart_data_scroll_offset_start (int) – Scroll offset start.
chart_data_scroll_offset_end (int) – Scroll offset end.
chart_data_legend_scroll_offset (int) – Legend scroll offset.
chart_data_zoom_min – Minimum chart data zoom.
chart_data_zoom_max – Maximum chart data zoom.
- Returns:
The handle and Id of the created snapshot.
- Return type:
dict
- embed_snapshot(app_handle: int, snapshot_id: str, slide_id: str)[source]
Embeds a created snapshot object on a slide.
- Parameters:
app_handle (int) – The handle of the app.
snapshot_id (str) – The id of the snapshot.
slide_id (str) – The id of the slide to embed.
- get_app_dimensions(app_handle)[source]
Retrieves a list with all app dimensions containing metadata.
- Parameters:
app_handle (int) – The handle of the app.
- Returns:
A table with all dimensions from an app.
- Return type:
DataFrame
- get_app_fields(app_handle)[source]
Retrieves a list with all app fields containing meta data.
- Parameters:
app_handle (int) – The handle of the app.
- Returns:
A table with all fields from an app.
- Return type:
DataFrame
- get_app_lineage(app_handle)[source]
Retrieves a list with an app lineage data.
- Parameters:
app_handle (int) – The handle of the app.
- Returns:
A table with lineage data from an app.
- Return type:
DataFrame
- get_app_lineage_info(app_handle)[source]
Gets the lineage information of the app. The lineage information includes the LOAD and STORE statements from the data load script associated with this app.
- Parameters:
app_handle (int) – The handle of the app.
Returns: DataFrame: Information about the lineage of the data in the app.
- get_app_measures(app_handle)[source]
Retrieves a list with all app measures containing metadata.
- Parameters:
app_handle (int) – The handle of the app.
- Returns:
A table with all measures from an app.
- Return type:
DataFrame
- get_app_sheets(app_handle)[source]
Retrieves a list with all app sheets and their content containing metadata.
- Parameters:
app_handle (int) – The handle of the app.
- Returns:
A table with all sheets and their content from an app.
- Return type:
DataFrame
- get_app_variables(app_handle)[source]
Retrieves a list with all app variables containing metadata.
- Parameters:
app_handle (int) – The handle of the app.
- Returns:
A table with all variables from an app.
- Return type:
DataFrame
- get_apps()[source]
Retrieves a list with all apps on the server containing metadata.
Parameters:
- Returns:
A table with all server apps.
- Return type:
DataFrame
- get_chart_data(app_handle, obj_id)[source]
Retrieves the data from a given chart object.
- Parameters:
app_handle (int) – The handle of the app.
obj_id (str) – The ID of the chart object.
Returns: DataFrame: A table of the chart content.
- get_constructed_table_data(app_handle, list_of_dimensions=[], list_of_measures=[], list_of_master_dimensions=[], list_of_master_measures=[])[source]
Creates a table from given fields, expressions, dimensions or measures and retrieves the data from it.
- Parameters:
app_handle (int) – The handle of the app.
list_of_dimensions (list) – A list of dimensions.
list_of_measures (list) – A list of measures.
list_of_master_dimensions (list) – A list of master dimensions.
list_of_master_measures (list) – A list of master measures.
- Returns:
A table of the chart content.
- Return type:
DataFrame
- static get_handle(obj)[source]
Retrieves the handle from a given object.
Parameters: obj : dict
The object containing the handle.
Returns: int: The handle value.
Raises: ValueError: If the handle value is invalid.
- static get_id(obj)[source]
Retrieves the id from a given object.
Parameters: obj : dict
The object containing the id.
Returns: int: The id value.
Raises: ValueError: If the id value is invalid.
- get_object_sheet(app_handle: int, obj_id: str)[source]
Retrieves the sheet from a given chart object.
- Parameters:
app_handle (int) – The handle of the app.
obj_id (str) – The ID of the object.
- Returns:
The sheet object with handle and id.
- Return type:
dict