Allows the kdb+ interpreter to manipulate Python objects and call Python functions. Part of the Fusion for kdb+ interface collection.
Please direct any questions to ai@kx.com.
Please report issues in this repository.
- kdb+ ≥ 3.5 64-bit
- Python ≥ 3.5.0 (macOS/Linux) ≥ 3.6.0 windows
You can either
- install embedPy to run on your local machine; or
- download or build a Docker image in which to run embedPy
There are three ways to install embedPy on your local machine:
-
Download and install a release
-
Clone and build from source, on your local machine or in a Docker image
-
Install with Conda - recommended for use with
- Anaconda Python
- mlnotebooks
- JupyterQ
If you are using Anaconda Python, we recommend installing with Conda. If, instead, you take option (1) or (2) above, and are using Linux or macOS, set your LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (macOS) to your Python distributions library directory to avoid conflicts between libraries which both q and Python use (e.g. libz, libssl). You can find this directory's location in Python.
>>> import sysconfig
>>> sysconfig.get_config_var('LIBDIR')If you are currently using PyQ, it also has a file p.so in $QHOME/{l64,m64}.
You may want to run initially from another directory, without installing. Skip the install step above, and run q in the directory where you unzipped the release.
The test script test.q requires the packages listed in tests/requirements.txt, although embedPy does not itself require them. They can be installed using pip or conda.
pip install -r tests/requirements.txtor
conda install --file tests/requirements.txtIf the tests all pass, no message is displayed.
-
Download a release archive from the releases page, and unzip it.
-
In the unzipped directory, run the tests.
$ q test.q
-
Install: put
p.qandp.kin QHOME and the library file (p.sofor macOS/Linux orp.dllfor Windows) in$QHOME/{l64,m64,w64}.
-
Clone this repository from GitHub.
-
To run embedPy without Internet access, download the kdb+ C API header file and place it in the build directory.
-
Build the interface and run the tests.
$ make p.so && q test.q -
Install: put
p.qandp.kin$QHOMEandp.soin$QHOME/{l64,m64}.
This requires either macOS or Linux.
-
Download and install either the full Anaconda distribution or Miniconda for Python3
-
Use the
condacommand to install packages as follows:$ conda install -c kx embedPy
Start q with embedPy
$ q p.qOr from q, load p.q.
q)\l p.qDocumentation is on the embedPy homepage.
If you have Docker installed, instead of installing embedPy on your machine, you can run:
$ docker run -it --name myembedpy kxsys/embedpy
kdb+ on demand - Personal Edition
[snipped]
I agree to the terms of the license agreement for kdb+ on demand Personal Edition (N/y): y
If applicable please provide your company name (press enter for none): ACME Limited
Please provide your name: Bob Smith
Please provide your email (requires validation): bob@example.com
KDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems
l64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 bob@example.com KOD #0000000
q)See docker/README.md for more details.
.p.key and .p.value removed
-
Attribute access from
embedPyobjectq)obj`ATTRNAME / old q)obj`:ATTRNAME / new
-
embedPyobjects can be called directly without explicitly specifying the call return type; the default return type is anembedPyobject
V0.2-beta features a number of changes back-incompatible with the previous release, V0.1-beta.
Most notably, the default type used in many operations is now the embedPy type, rather than the foreign type.