Skip to content

Allows the kdb+ interpreter to call Python functions

License

Notifications You must be signed in to change notification settings

elopezaguilera/embedPy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

embedPy

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 [email protected].

Please report issues in this repository.

Requirements

  • kdb+ >=3.5 64-bit
  • Anaconda Python 3.x

Installation

Download

Download the appropriate release archive from the releases page.

Run tests with

q test.q

To install, place p.q and p.k in $QHOME and place the library file (p.so for OSX/Linux or p.dll for Windows) in $QHOME/{l64,m64,w64}

Watch out On OSX and Linux if you are using Anaconda python rather than the system python, you should set your LD_LIBRARY_PATH (on Linux) or DYLD_LIBRARY_PATH (on OSX) to your python distributions library directory before starting q 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')

Watch out If you are currently using PyQ, it also has a file p.so in $QHOME/{l64,m64}. In this case, you may want to run initially from the local directory without installing. Skip the install step and run q in the directory where you unzipped the release to do this.

Building from source

Build the interface and run sanity checks with

make p.so && q test.q

If running in an environment without Internet access, you will need to download the kdb+ C API header file manually and place in the build directory.

To install, place p.q and p.k in $QHOME and p.so in $QHOME/{l64,m64}.

Docker

If you have Docker installed you can alternatively 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): [email protected]
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 [email protected] KOD #0000000

q)

N.B. Further options for running and build instructions for the image are available here

Usage

From q, load p.q.

q)\l p.q

Documentation

Documentation is available on the embedPy homepage.

Back-incompatible changes

V1.0 -> V 1.1

.p.key and .p.value removed

V0.2-beta -> V1.0

  • Attribute access from embedPy object
q)obj`ATTRNAME   / old
q)obj`:ATTRNAME  / new
  • embedPy objects can be called directly without explicitly specifying the call return type, the default return type is an embedPy object

V0.1-beta -> V0.2beta in V0.2-beta

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.

About

Allows the kdb+ interpreter to call Python functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 40.5%
  • C 23.3%
  • Other 18.2%
  • q 12.1%
  • Perl 2.3%
  • Makefile 1.8%
  • Other 1.8%