Pushing wheel files with kxi pm push¶
This page explains how to push existing Python wheels into kdb Insights Enterprise and then leverage them as shown in the Python walkthrough page.
kxi pm push accepts Python wheel files (.whl) in addition to .kxi packages and package directories.
Usage¶
kxi pm push <path-to-wheel>
The wheel must contain a valid .dist-info/METADATA file with Name and Version fields. The package name and version are read from those fields — no separate manifest is required.
Options¶
| Flag | Description |
|---|---|
--force |
Overwrite if the package already exists |
Example¶
kxi pm push ./my_library-1.2.3-py3-none-any.whl
Development workflow¶
This section walks through the full cycle of developing a Python library locally, publishing it via the Package Manager, and consuming it inside a kdb Insights Enterprise package.
1. Develop locally¶
Write and iterate on your Python library as a standard Python project with a pyproject.toml:
my_library/
├── pyproject.toml
└── src/
└── my_library/
├── __init__.py
└── transforms.py
2. Build the wheel¶
Use uv to produce a wheel:
uv build --wheel .
This writes a file such as dist/my_library-1.0.0-py3-none-any.whl.
3. Push the wheel¶
kxi pm push dist/my_library-1.0.0-py3-none-any.whl
The package name and version are read from the wheel's metadata — no separate manifest is required.
4. Declare the dependency¶
In your kdb Insights Enterprise package's manifest.yaml, list the wheel by name and pin the version:
name: my-kxi-package
version: 0.0.1
dependencies:
- my_library==1.0.0
The Package Manager resolves and installs the wheel into the Python runtime before any pipeline or UDA starts.
5. Import the library¶
Custom packages and analytics are stored under KX_PACKAGE_PATH. You must add this to sys.path before importing them:
import os
import sys
sys.path.append(os.getenv("KX_PACKAGE_PATH"))
from my_library import transforms
Note
This sys.path.append call is an explicit opt-in — it is not done
automatically. Without it, imports of downloaded Python libraries will fail.
Notes¶
--lock-q-filesand--deployhave no effect on wheel uploads.- Once pushed, the wheel is served as-is via the PyPI-compatible endpoint, so you can install it directly with
piporuv.