Skip to content

kdb Insights Python API

The kdb Insights Python API provides the capability to interact with kdb Insights Enterprise from Python. This library allows you to issue queries against each of these products. See the installation section below for information on how you can install this library. Once installed the quickstart guide will provide you with examples of querying kdb Insights Enterprise using the various functionality available to you.

API Sections

  • Query - Functionality for the querying of kdb Insights functionality

Installation

Note

Python packages should typically be installed in a virtual environment. This can be done with the venv package from the standard library.

To install the kdb Insights Python API ensure you have a recent version of pip installed:

pip install --upgrade pip

Then to install the kxi library run the following command:

pip install --extra-index-url=https://$KX_PYPI_USER:$KX_PYPI_PASS@nexus.dl.kx.com/repository/kxi-pypi-public/simple kxi

To ensure that you can install in this manner you must get access to a username and password for the KX Nexus and set these to the environment variables KX_PYPI_USER and KX_PYPI_PASS respectively. To gain access to these credentials contact sales@kx.com.

To get full usage of the kxi library it is suggested that a user additionally install the library pykx. This is not installed by default on installation of the kxi library and as such can be installed as follows:

pip install --extra-index-url=https://$KX_PYPI_USER:$KX_PYPI_PASS@nexus.dl.kx.com/repository/kxi-pypi-public/simple "kxi[all]"

The addition of [all] above allows PyKX to be retrieved from https://pypi.org/.

Python Dependencies

The kdb Insights Python API has the following dependencies which will be included with installation of the library

Library Version Required
oauthlib 3.2.0 Yes
requests 2.28.1 Yes
requests-oauthlib 1.3.1 Yes
furl 2.1.3 Yes
pykx >=1.3.1 No