qe-api-client 2.5.0__tar.gz → 2.7.0__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.
Files changed (31) hide show
  1. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/PKG-INFO +4 -3
  2. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/README.md +1 -1
  3. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_app_api.py +3 -3
  4. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_generic_dimension_api.py +19 -0
  5. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_generic_object_api.py +35 -5
  6. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/engine.py +504 -18
  7. qe_api_client-2.7.0/qe_api_client/structs.py +541 -0
  8. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client.egg-info/PKG-INFO +4 -3
  9. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/setup.py +1 -1
  10. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_app_api.py +2 -2
  11. qe_api_client-2.5.0/qe_api_client/structs.py +0 -122
  12. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/LICENSE +0 -0
  13. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/__init__.py +0 -0
  14. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/__init__.py +0 -0
  15. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_field_api.py +0 -0
  16. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_generic_measure_api.py +0 -0
  17. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_generic_variable_api.py +0 -0
  18. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/api_classes/engine_global_api.py +0 -0
  19. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client/engine_communicator.py +0 -0
  20. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client.egg-info/SOURCES.txt +0 -0
  21. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client.egg-info/dependency_links.txt +0 -0
  22. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client.egg-info/requires.txt +0 -0
  23. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/qe_api_client.egg-info/top_level.txt +0 -0
  24. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/setup.cfg +0 -0
  25. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test.py +0 -0
  26. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_api.py +0 -0
  27. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_chart_content.py +0 -0
  28. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_field_api.py +0 -0
  29. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_global_api.py +0 -0
  30. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_labs.py +0 -0
  31. {qe_api_client-2.5.0 → qe_api_client-2.7.0}/test/test_pyqlikengine.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: qe-api-client
3
- Version: 2.5.0
3
+ Version: 2.7.0
4
4
  Summary: Python client for the Qlik Engine JSON API
5
5
  Home-page: https://github.com/lr-bicc/qe-api-client
6
6
  Author: Rumen Vasilev
@@ -19,13 +19,14 @@ Dynamic: classifier
19
19
  Dynamic: description
20
20
  Dynamic: description-content-type
21
21
  Dynamic: home-page
22
+ Dynamic: license-file
22
23
  Dynamic: requires-dist
23
24
  Dynamic: requires-python
24
25
  Dynamic: summary
25
26
 
26
27
  # Qlik Engine API Client
27
28
 
28
- Python wrapper around [Qlik Engine JSON API](https://help.qlik.com/en-US/sense-developer/February2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/introducing-engine-API.htm)
29
+ Python client for the [Qlik Engine JSON API](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/introducing-engine-API.htm)
29
30
 
30
31
  Forked from [jhettler/pyqlikengine](https://github.com/jhettler/pyqlikengine)
31
32
 
@@ -1,6 +1,6 @@
1
1
  # Qlik Engine API Client
2
2
 
3
- Python wrapper around [Qlik Engine JSON API](https://help.qlik.com/en-US/sense-developer/February2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/introducing-engine-API.htm)
3
+ Python client for the [Qlik Engine JSON API](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/introducing-engine-API.htm)
4
4
 
5
5
  Forked from [jhettler/pyqlikengine](https://github.com/jhettler/pyqlikengine)
6
6
 
@@ -115,18 +115,18 @@ class EngineAppApi:
115
115
  except KeyError:
116
116
  return response['error']
117
117
 
118
- def get_object(self, doc_handle, object_id):
118
+ def get_object(self, app_handle, object_id):
119
119
  """
120
120
  Retrieves a specific object from the app identified by the document handle.
121
121
 
122
122
  Parameters:
123
- doc_handle (int): The handle identifying the app document.
123
+ app_handle (int): The handle identifying the app document.
124
124
  object_id (str): The ID of the object to retrieve.
125
125
 
126
126
  Returns:
127
127
  dict: The retrieved object (qReturn). In case of an error, returns the error information.
128
128
  """
129
- msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetObject",
129
+ msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": app_handle, "method": "GetObject",
130
130
  "params": {"qId": object_id}})
131
131
  response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
132
132
  try:
@@ -36,3 +36,22 @@ class EngineGenericDimensionApi:
36
36
  return response["result"]["qReturn"]
37
37
  except KeyError:
38
38
  return response["error"]
39
+
40
+ def apply_patches(self, handle: int, patches: list):
41
+ """
42
+ Applies a patch to the properties of an object. Allows an update to some of the properties.
43
+
44
+ Parameters:
45
+ handle (int): The handle identifying the generic object.
46
+ patches (list): List of patches.
47
+
48
+ Returns:
49
+ dict: Operation succeeded.
50
+ """
51
+ msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "ApplyPatches",
52
+ "params": {"qPatches": patches}})
53
+ response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
54
+ try:
55
+ return response["result"]
56
+ except KeyError:
57
+ return response["error"]
@@ -24,24 +24,54 @@ class EngineGenericObjectApi:
24
24
  socket (object): The socket connection to the Qlik Sense engine.
25
25
  """
26
26
  self.engine_socket = socket
27
- def create_child(self, handle, params):
27
+
28
+ def apply_patches(self, handle: int, patches: list, soft_patch: bool = False):
28
29
  """
29
- Retrieves the layout structure of a specific generic object.
30
+ Applies a patch to the properties of an object. Allows an update to some of the properties. It is possible to
31
+ apply a patch to the properties of a generic object, that is not persistent. Such a patch is called a soft patch.
32
+ In that case, the result of the operation on the properties (add, remove or delete) is not shown when doing
33
+ GetProperties, and only a GetLayout call shows the result of the operation. Properties that are not persistent
34
+ are called soft properties. Once the engine session is over, soft properties are cleared. It should not be
35
+ possible to patch "/qInfo/qId", and it will be forbidden in the near future.
30
36
 
31
37
  Parameters:
32
38
  handle (int): The handle identifying the generic object.
33
- params (str): The parameters of the generic object.
39
+ patches (list): List of patches.
40
+ soft_patch (bool, optional): If set to true, it means that the properties to be applied are not persistent.
41
+ The patch is a soft patch. The default value is false.
34
42
 
35
43
  Returns:
36
- dict: The layout structure of the generic object (qLayout). In case of an error, returns the error information.
44
+ dict: Operation succeeded.
37
45
  """
38
- msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "CreateChild", "params": [params]})
46
+ msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "ApplyPatches",
47
+ "params": {"qPatches": patches, "qSoftPatch": soft_patch}})
39
48
  response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
40
49
  try:
41
50
  return response["result"]
42
51
  except KeyError:
43
52
  return response["error"]
44
53
 
54
+ def create_child(self, handle: int, prop: dict, prop_for_this: dict = None):
55
+ """
56
+ Creates a generic object that is a child of another generic object.
57
+
58
+ Parameters:
59
+ handle (int): The handle identifying the generic object.
60
+ prop (dict): Information about the child. It is possible to create a child that is linked to another object.
61
+ prop_for_this (dict, optional): Identifier of the parent's object. Should be set to update the properties of
62
+ the parent's object at the same time the child is created.
63
+
64
+ Returns:
65
+ dict: The layout structure of the generic object (qLayout). In case of an error, returns the error information.
66
+ """
67
+ msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "CreateChild",
68
+ "params": {"qProp": prop, "qPropForThis": prop_for_this}})
69
+ response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
70
+ try:
71
+ return response["result"]["qReturn"]
72
+ except KeyError:
73
+ return response["error"]
74
+
45
75
  def get_layout(self, handle):
46
76
  """
47
77
  Retrieves the layout structure of a specific generic object.