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. Refer to the installation section below for information on how you can install this library. Once installed the quickstart guide provides you with examples of querying kdb Insights Enterprise using the various functionality available to you.

KX Nexus

The KX Nexus repository will be sunsetted in the future. Nexus links on this page are provided as a temporary alternative to the KX Downloads Portal for existing users. The KX Downloads Portal is the preferred repository for all use cases and KX Nexus links will be removed once the KX Nexus repository is decommissioned.

API Section

  • 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 --no-input install --extra-index-url=https://portal.dl.kx.com/assets/pypi/ kxi

The above command uses the KX Downloads Portal and new users must use that command.

Existing users can use the following command to instead install from KX Nexus, until Nexus is removed in the future:

pip --no-input install --extra-index-url=https://nexus.dl.kx.com/repository/kxi-pypi-public/simple/ kxi

The pykx library isn't installed by default on installations of the kxi library. To fully utilize the kxi library, use the following command to install the pykx library from the KX Downloads Portal:

pip --no-input install --extra-index-url=https://portal.dl.kx.com/assets/pypi/ "kxi[all]"

Alternatively, for existing users, use this command to install the pykx library from KX Nexus:

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

The addition of the [all] argument enables 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