Skip to content

qmamba package manager

This page explains what the qmamba package manager is and when to use it. The package manager is currently available in a public preview capacity and all feedback on it is welcome

qmamba is a package manager for KDB-X, built using libmamba.

It enables you to download and install KDB-X modules from inside a q session with a few commands. You can source the modules from the KX channel on anaconda as prebuilt packages, and qmamba automatically fetches any dependencies and resolves any conflicts.

qmamba also supports multiple independent environments. You can install packages into separate environments and switch between them.

Use cases

Use qmamba when you want to:

  • Install a KDB-X module without building it from source: fetch prebuilt packages from the KX channel and let qmamba resolve the dependency tree for you.
  • Mix KX and third-party packages: draw KDB-X modules from the kx channel and their native dependencies from conda-forge in a single transaction.
  • Isolate work in separate environments: keep the packages for each project in their own environment and switch between them without reinstalling.
  • Manage packages from inside q: search, install, list, and update packages in a running q session instead of a separate CLI.

Prerequisites

qmamba supports the following platforms:

  • Linux (x86_64)
  • Linux ARM (aarch64)
  • macOS (Intel and Apple Silicon)

Background

qmamba provides a rich set of APIs to:

  • search for packages
  • install and manage packages
  • create and manage environments

The qmamba APIs mirror the mamba CLI commands, so if you have experience using micromamba or miniconda, they are already familiar. Basic APIs such as search, install, and list are common to most package managers. Anyone who has used apt, yum, brew, or vcpkg can get started quickly.

Load qmamba

Load qmamba as a module with use:

q)qmamba:use `kx.qmamba

Get help with the APIs

Each API takes a dictionary input of options. To see the available options for a given API, their types, and a description, pass `help to the API. For example:

q)qmamba.install `help
option            | type       default    description
------------------| ---------------------------------------------------------------------------------------------------------------
ALLOW_DOWNGRADE   | int        0          "Allow downgrade when installing packages"
ALLOW_UNINSTALL   | int        1          "Allow uninstall when installing or updating packages"
...
VERIFY_ARTIFACTS  | int        0          "Run verifications on packages signatures (experimental)"
YES               | int        0          "Automatically answer yes on prompted questions"
...

Most APIs also have a shortcut which allows you to specify the most commonly used option for that operation without having to wrap it in a dictionary. For example:

  • qmamba.install enlist "package" is the same as qmamba.install (enlist `SPECS)!(enlist enlist "package")
  • qmamba.activate "name" is the same as qmamba.activate (enlist `NAME)!(enlist "name"))
  • shortcuts for other APIs are detailed in the function reference

Next steps

A few concepts are used extensively in the rest of this documentation. Get familiar with them first by reading the Concepts page.

Then continue with Getting started for a quick tour of the basic functionality.