Skip to main content

About

qsAPI is a client for Qlik Sense QPS and QRS interfaces written in python that provides an environment for managing a Qlik Sense site via programming or interactive console. The module provides a set of commands for viewing and editing configuration settings, as well as managing tasks and other features available through APIs.

Installation

You could use your preferred IDE (Eclipse, Visual Code, NetBeans, etc.) with the python interpreter 3.x or directly in console. Take a look at (https://www.python.org). Once the module is loaded you can view a list of available commands with the autocomplete tooltips.

The python requests library is a requisite (http://docs.python-requests.org/en/master/user/install/). Just execute in the command line:

pip install qsAPI

Optionally, if you plan connect using NTLM authentication, then the library requests_ntlm too.

pip install qsAPI request_ntlm

Now, the module can be used just importing qsAPI.py at the beginning of your python script or console, the module will then be loaded and ready to use.

>>> import qsAPI

IDE screenshot

Or just a simple command line console if complex scripts are no needed: console screenshot

Usage

Connecting with certificates

The first step is to build a handler invoking the constructor of the class you will use containing the host parameters, this will attempt to connect to the Qlik Sense server. Just export previously from QlikSense console the certificate in portable format and copy the folder in your machine:

>>> qrs=qsAPI.QRS(proxy='hostname', certificate='path\\client.pem')

Connecting with windows credentials (NTLM)

Alternatively, the constructor accept user credentials via arguments.

>>> qrs=qsAPI.QRS(proxy='hostname', user=('yor_domain','username','password'))

Examples

Count users using a filter

qrs.count('user',"Name eq 'sa_repository'")

Duplicate an application in the server

qrs.AppCopy('a99babf2-3c9d-439d-99d2-66fa7276604e',"HELLO world")

Export an application

qrs.AppExport('a99babf2-3c9d-439d-99d2-66fa7276604e',"c:\\path\\myAppName.qvf")

Export all published applications to directories

for app in qrs.AppGet(pFilter="stream.name ne 'None'"):
	os.makedirs(app['stream']['name'], exist_ok=True)
	qrs.AppExport(app['id'], app['stream']['name']+'\\'+app['name'])

Retrieve security rules using a filter

qrs.SystemRules("type eq 'Custom'")

Retrieve a list of sessions for a user

[x['SessionId'] for x in qps.GetUser('DIR', 'name').json()]
qps.DeleteUser('DIR','name')
More examples

Take a look at the Wiki area: (https://github.com/rafael-sanz/qsAPI/wiki)

Command Line

Alternative command line is available too, examples:

qsAPI --help
qsAPI -s myServer -c dir/client.pem -Q QRS StreamDictAttributes
qsAPI -s myServer -c dir/client.pem -Q QRS -v INFO AppExport d8b120d7-a6e4-42ff-90b2-2ac6a3d92233
qsAPI -s myServer -c dir/client.pem -Q QRS -v INFO AppReload d8b120d7-a6e4-42ff-90b2-2ac6a3d92233

TODO

The module is in progress, a subset of methods are implemented. But all the endpoints could be handled through the inner class driver and the methods get, post, put, delete.

qps.driver.get('/qrs/about/api/enums')

License

This software is made available "AS IS" without warranty of any kind. Qlik support agreement does not cover support for this software.

Metadata

Release files for qsAPI 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qsAPI 2.0
File Size Uploaded Provenance Actions
qsAPI-2.0.tar.gz 13.5 kB Without provenance Details for qsAPI-2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qsAPI 2.0
File Interpreter ABI Platform Actions
qsAPI-2.0-py3-none-any.whl Python 3 none any Details for qsAPI-2.0-py3-none-any.whl

Total release size: 38.0 kB

Release files / qsAPI-2.0.tar.gz

Download URL qsAPI-2.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e0ac70bc90da4e8dea8e572fcdee7f04d94aaada83d0509c6102ff258357d9d4
BLAKE2b-256 checksum
How to use checksums
8826e670c90d5dcb68a78c5315fa261b4ef290098c0de3f7a0353d50bafdf404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

Release files / qsAPI-2.0-py3-none-any.whl

Download URL qsAPI-2.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73e0f408116b3b500cab158a16a4fc25f845e571e6c3d6a381240de629d8b082
BLAKE2b-256 checksum
How to use checksums
2dd5572db5b06c3a7f66818c4ac833e0e93a81123feaf20085a1985e61badda9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

Security for qsAPI 2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page