App API Module

class qe_api_client.api_classes.engine_app_api.EngineAppApi(socket)[source]

Bases: object

API class for interacting with Qlik Sense engine’s app-related functionalities, such as script management, reloading, and object creation.

get_script(doc_handle)[source]

Retrieves the script of the app.

set_script(doc_handle, script)[source]

Sets the script of the app.

do_reload(doc_handle, param_list)[source]

Triggers a reload of the app.

do_reload_ex(doc_handle, param_list)[source]

Triggers an extended reload of the app.

get_app_layout(doc_handle)[source]

Retrieves the layout structure of the app.

get_object(doc_handle, object_id)[source]

Retrieves a specific object from the app.

get_field(doc_handle, field_name, state_name)[source]

Retrieves a specific field from the app.

create_object(doc_handle, q_id, q_type, struct_name, ob_struct)[source]

Creates a new object in the app.

add_alternate_state(doc_handle: int, state_name)[source]
add_field_from_expression(doc_handle: int, field_name, expr_value)[source]
apply_bookmark(doc_handle, bookmark_id)[source]
check_expression(doc_handle: int, expr_value)[source]
check_script(doc_handle: int)[source]
clear_all(doc_handle: int, locked_also=False, alt_state='')[source]

Clear selections in fields for current state. Locked fields are not cleared by default.

Parameters:
  • doc_handle (int) – The handle identifying the app document.

  • locked_also (bool) – When true, clears the selection for locked fields.

  • alt_state (str) – Alternate state name. When set, applies to alternate state instead of current.

create_bookmark(doc_handle: int, prop: dict)[source]

Creates a bookmark.

Parameters:
  • doc_handle (int) – The handle identifying the document.

  • prop (dict) – Bookmark properties.

Returns:

The handle of the generic bookmark.

Return type:

dict

create_connection(doc_handle: int, connect_name, connect_string, connect_type, user_name, password, mod_date='', meta='', sso_passthrough='LOG_ON_SERVICE_USER')[source]
create_dimension(doc_handle: int, prop)[source]
create_measure(doc_handle: int, prop)[source]
create_object(doc_handle: int, prop)[source]

Creates a new object in the app identified by the document handle.

Parameters:
  • doc_handle (int) – The handle identifying the app document.

  • prop (dict) – Information about the object.

Returns:

The created object (qReturn). In case of an error, returns the error information.

Return type:

dict

create_session_object(doc_handle: int, prop)[source]
create_session_variable(doc_handle: int, var_id='', var_name='', var_comment='', var_def='')[source]
create_variable(doc_handle: int, var_id='', var_name='', var_comment='', var_def='')[source]
destroy_dimension(doc_handle: int, dim_id)[source]
destroy_measure(doc_handle: int, measure_id)[source]
destroy_object(doc_handle: int, object_id)[source]
destroy_session_object(doc_handle: int, object_id)[source]
destroy_session_variable(doc_handle: int, var_id)[source]
destroy_variable_by_id(doc_handle: int, var_name)[source]
do_reload(doc_handle: int, param_list=[])[source]

Triggers a reload of the app identified by the document handle.

Parameters:
  • doc_handle (int) – The handle identifying the app document.

  • param_list (list) – A list of parameters for the reload operation. Default is an empty list.

Returns:

The result of the reload operation. In case of an error, returns the error information.

Return type:

dict

do_reload_ex(doc_handle: int, param_list={})[source]

Triggers an extended reload of the app identified by the document handle.

Parameters:
  • doc_handle (int) – The handle identifying the app document.

  • param_list (list) – A list of parameters for the extended reload operation. Default is an empty list.

Returns:

The result of the extended reload operation. In case of an error, returns the error information.

Return type:

dict

do_save(doc_handle: int, file_name='')[source]
expr_eval(doc_handle: int, expr)[source]
get_all_infos(doc_handle: int)[source]
get_app_layout(doc_handle: int)[source]

Retrieves the layout structure of the app identified by the document handle.

Parameters:

doc_handle (int) – The handle identifying the app document.

Returns:

The layout structure of the app (qLayout). In case of an error, returns the error information.

Return type:

dict

get_app_properties(doc_handle: int)[source]
get_bookmark(app_handle: int, bookmark_id: str)[source]

Retrieves a specific bookmark from the app identified by the document handle.

Parameters:
  • app_handle (int) – The handle identifying the app document.

  • bookmark_id (str) – The ID of the bookmark to retrieve.

Returns:

The retrieved object (qReturn). In case of an error, returns the error information.

Return type:

dict

get_bookmarks(doc_handle: int, options: dict)[source]

Returns all bookmarks compatible with options.

Parameters:
  • doc_handle (int) – The handle identifying the document.

  • qOptions (dict) – Bookmark type filter and requested properties.

Returns:

The resulting list.

Return type:

list

get_connection(doc_handle: int, connection_id)[source]
get_connections(doc_handle: int)[source]
get_databases(doc_handle: int, connection_id)[source]
get_db_info(doc_handle: int, connection_id)[source]
get_db_owners(doc_handle: int, connection_id)[source]
get_db_table_fields(doc_handle: int, connection_id, db_name='', db_owner='', table_name='')[source]
get_db_table_preview(doc_handle: int, connection_id, db_name='', db_owner='', table_name='')[source]
get_db_tables(doc_handle: int, connection_id, db_name='', db_owner='')[source]
get_empty_script(doc_handle: int)[source]
get_field(doc_handle: int, field_name, state_name='')[source]

Retrieves a specific field from the app identified by the document handle.

Parameters:
  • doc_handle (int) – The handle identifying the app document.

  • field_name (str) – The name of the field to retrieve.

  • state_name (str) – The name of the alternate state. Default state is current selections.

Returns:

Object interface.

Return type:

dict

get_field_descr(doc_handle: int, field_name)[source]
get_file_table_ex(doc_handle: int, connection_id, rel_path='', data_fmt='')[source]
get_file_table_fields(doc_handle: int, connection_id, rel_path='', data_fmt='', table_name='')[source]
get_file_table_preview(doc_handle: int, connection_id, rel_path='', data_fmt='', table_name='')[source]
get_file_tables(doc_handle: int, connection_id, rel_path='', data_fmt='')[source]
get_folder_items_for_connection(doc_handle: int, connection_id)[source]
get_lineage(doc_handle: int)[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:

doc_handle (int) – The handle identifying the app document.

Returns:

Information about the lineage of the data in the app.

Return type:

list

get_object(app_handle: int, object_id: str)[source]

Retrieves a specific object from the app identified by the document handle.

Parameters:
  • app_handle (int) – The handle identifying the app document.

  • object_id (str) – The ID of the object to retrieve.

Returns:

The retrieved object (qReturn). In case of an error, returns the error information.

Return type:

dict

get_objects(app_handle: int, options: dict)[source]

Retrieves a specific object from the app identified by the document handle.

Parameters:
  • app_handle (int) – The handle identifying the app document.

  • object_id (str) – The ID of the object to retrieve.

Returns:

The retrieved object (qReturn). In case of an error, returns the error information.

Return type:

dict

get_script(doc_handle: int)[source]

Retrieves the script of the app identified by the document handle.

Parameters:

doc_handle (int) – The handle identifying the app document.

Returns:

The script of the app (qScript). In case of an error, returns the error information.

Return type:

str

get_set_analysis(doc_handle: int, state_name='', bookmark_id='')[source]
get_variable_by_id(doc_handle: int, variable_id)[source]

Gets the handle of a variable.

Parameters:
  • doc_handle (int) – The handle identifying the document.

  • variable_id (str) – The id of the variable.

Returns:

The handle of the generic variable.

Return type:

dict

set_script(doc_handle: int, script)[source]

Sets the script of the app identified by the document handle.

Parameters:
  • doc_handle (int) – The handle identifying the app document.

  • script (str) – The script content to be set.

Returns:

The result of setting the script. In case of an error, returns the error information.

Return type:

dict