Skip to content

QlikSense python API client for QPS and QRS interfaces

License

Notifications You must be signed in to change notification settings

scm-spain/backend-bi--qliksense-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 Studio, NetBeans, …) with the python interpreter 3.x or directly in console. Take a look at (http://www.activestate.com/activepython) or (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 requests

The module can be used 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')

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()]

teardown of all connections for the user and related sessions

qps.DeleteUser('DIR','name')
More examples

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

TODO

The module is in progress, just a subset of method 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').json()

License

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

About

QlikSense python API client for QPS and QRS interfaces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%