{"library":"qsapi","title":"Qlik Sense qsAPI Client","description":"qsAPI is a Python client library designed for interacting with Qlik Sense's QPS (Qlik Proxy Service) and QRS (Qlik Repository Service) interfaces. It simplifies common administrative and data operations within a Qlik Sense environment, providing a programmatic way to manage apps, users, security rules, and more. The current version is 2.2.0, and the library receives updates periodically, with major refactorings in its 2.1.0 release.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install qsapi"],"cli":null},"imports":["from qsapi.qsapi import QlikSenseAPI"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom qsapi.qsapi import QlikSenseAPI\n\n# Configure Qlik Sense connection details. Use environment variables for production.\nHOST = os.environ.get('QLIK_SENSE_HOST', 'your_qlik_sense_host') # e.g., 'yourserver.example.com'\nCERT_PATH = os.environ.get('QLIK_SENSE_CERT_PATH', '/path/to/client.pem')\nKEY_PATH = os.environ.get('QLIK_SENSE_KEY_PATH', '/path/to/client_key.pem')\nUSER_DIRECTORY = os.environ.get('QLIK_SENSE_USER_DIRECTORY', 'DOMAIN') # e.g., 'YOURDOMAIN'\nUSER_ID = os.environ.get('QLIK_SENSE_USER_ID', 'svc_api_user')\n\ntry:\n    # Initialize the Qlik Sense API client\n    qs_api = QlikSenseAPI(\n        host=HOST,\n        certificate=CERT_PATH,\n        key=KEY_PATH,\n        user_directory=USER_DIRECTORY,\n        user_id=USER_ID\n    )\n\n    # Example: Get Qlik Sense Engine Version\n    engine_version = qs_api.get_engine_version()\n    print(f\"Successfully connected to Qlik Sense. Engine Version: {engine_version}\")\n\n    # Example: Get a list of apps (uncomment to run)\n    # apps = qs_api.get_apps()\n    # print(f\"Found {len(apps)} applications.\")\n    # for app in apps[:2]: # Print details for the first two apps\n    #     print(f\"  - App Name: {app.name}, ID: {app.id}\")\n\nexcept FileNotFoundError as e:\n    print(f\"Error: Certificate or key file not found: {e}. Please ensure paths are correct.\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the `QlikSenseAPI` client using certificate-based authentication and fetch the Qlik Sense engine version. It highlights common configuration parameters for connecting to a Qlik Sense Enterprise server.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}