The Deephaven Python Client for Ticking Tables
Project description
Deephaven Python Ticking Package
The pydeephaven-ticking
package enables access to ticking Deephaven data from Python. It extends
the functionality of the pydeephaven package to add the ability to subscribe to tables and receive
change notifications containing added, removed, and modified data. It uses Cython to create a thin
wrapper around Deephaven's C++ library.
Prerequisites
The Deephaven C++ client (and ticking Python client) are tested regularly on Ubuntu 22.04 x86_64. Additionally, successful tests have been run on RHEL 8 and Fedora 38 (both on x86_64). Windows support is expected to be made available in the future.
Installation
pydeephaven-ticking
can be installed with pip
or by building from source.
pip
A Linux operating system on x86_64 architecture is required to install via pip
.
It's recommended to install this way in a Python virtual environment (venv).
pip install pydeephaven-ticking
Build from source
If building from source, pydeephaven-ticking
also requires a working installation of the C++
client. All four packages (Deephaven Core, pydeephaven
, pydeephaven-ticking
, and the Deephaven
C++ client) are present in the deephaven-core
repository. It is assumed that you have the repository checked out at the location specified by
${DHROOT}
.
Install the C++ client
First, install the Deephaven C++ client. Follow the instructions in $DHROOT/cpp-client/README.md
.
Note the restrictions on supported platforms mentioned there. The instructions will ask you to
select a location for the installation of the C++ client library and its dependencies. For the
purpose of this document we assume that location is specified in the ${DHCPP}
environment
variable.
Install pydeephaven
To install pydeephaven, follow the instructions in ${DHROOT}/py/client/README.md
.
These instructions will require you to create a Python venv. After installing that package, you will continue to use that venv here.
Build the ticking Python client
Install Cython in the venv
If you've exited your venv, re-activate it with something like:
source ~/py/cython/bin/activate
Then run
pip3 install cython
Build the shared library:
cd ${DHROOT}/py/client-ticking
# Ensure the DHCPP environment variable is set per the instructions above
rm -rf build dist # Ensure we clean the remnants of any pre-existing build.
DEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) CFLAGS="-I${DHCPP}/include" LDFLAGS="-L${DHCPP}/lib" python3 setup.py build_ext -i
Install pydeephaven-ticking
Build the wheel with
DEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) python3 setup.py bdist_wheel
Then install the package.
Note: the actual name of the .whl
file may be different depending on system details.
pip3 install --force --no-deps dist/pydeephaven_ticking-<x.y.z>-cp310-cp310-linux_x86_64.whl
The --force
flag is required to overwrite any previously-built version of the package that might
already be there. The --no-deps
flag ensures that we are sure to refer to the pydeephaven
package just built from the above steps, rather than one from PyPi.
Testing the library
Run python from the venv while in this directory, and try this sample Python program:
import pydeephaven as dh
import time
session = dh.Session() # assuming Deephaven Community Core is running locally with the default configuration
table = session.time_table(period=1000000000).update(formulas=["Col1 = i"])
listener_handle = dh.listen(table, lambda update : print(update.added()))
listener_handle.start()
# data starts printing asynchronously here
time.sleep(10)
listener_handle.stop()
session.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pydeephaven_ticking-0.36.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7247cc246884b85b0d56125401d01924aa4a58f2a71fbcaa8e90c7075ce54b36 |
|
MD5 | beb5ca6fec54e7db8df928c1216a5209 |
|
BLAKE2b-256 | c797130ebdf2c5d344a6cc095e0c5a292494d18fab6d0bb461715e3ec283a44a |
Hashes for pydeephaven_ticking-0.36.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0342a4714591d4e0d21f2cc363e8e0e2c67311dd066862e9eff3f7de5814c2 |
|
MD5 | 9273123c326eae8dbd81e96367001cce |
|
BLAKE2b-256 | b0d18debc49e40215b99961c373bd9df5201c5ef8718ca3ecd7bf47f1f5c2602 |
Hashes for pydeephaven_ticking-0.36.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce0af165553c3c4d31666c95de3a914ea25d36f88a56d04dd4f1786cb0d57fad |
|
MD5 | 15a8281649fb377a74f88dfd764388ee |
|
BLAKE2b-256 | a8d9925356ccc4919e9b82258ff861129c6d8e3751894c70ee3a5d4defc1dbb9 |
Hashes for pydeephaven_ticking-0.36.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02c85845149469b134571bc39e6cfbb2a95bb70b1a71ed38e1c9bf8dd31e463 |
|
MD5 | 94111f534415871698c3b9489c4eb8e6 |
|
BLAKE2b-256 | 2724fa2bb31f6f84c3a9e338947c0bea3cd674a0507e3154b7b798dec8d70034 |
Hashes for pydeephaven_ticking-0.36.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c19bc1dc3631a95df965c8b83c684a1e1cf668abbdb569d840766b31978bd2c1 |
|
MD5 | 3bfd78dcca5c0a19ce49418efffc81d3 |
|
BLAKE2b-256 | c7ab9255514b8308f97f44b9206bd84632e658e73e85834f466b7f759721f127 |