# 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 or Windows 10 64 bits is requi!red to install via `pip`.
It's recommended to install this way in a Python virtual environment (venv).
```sh
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](https://github.com/deephaven/deephaven-core)
repository. It is assumed that you have the repository checked out at the location specified by
`${DHROOT}` (for Linux) or `%DHSRC%` (for Windows).
### Install the C++ client
First, install the Deephaven C++ client. Follow the instructions in `$DHROOT/cpp-client/README.md`
(for Linux) or `%DHSRC\cpp-client\README.md` (for Windows).
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.
According to the C++ build instructions, and depending on platform,
the location is specified in an environment variable as follows:
* On Linux: the location is specified in the `${DHCPP}` environment variable.
* On Windows: the location is specified in the `%DHINSTALL%` environment variable.
### Install pydeephaven
To install pydeephaven, follow the instructions in `${DHROOT}/py/client/README.md` (on Linux)
or `%DHSRC%\py\client\README.md` (on Windows).
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.
For Linux:
```sh
# This assumes your venv is in $HOME/py/cython
source ~/py/cython/bin/activate
```
For Windows
```bat
rem This assumes your venv is in %DHINSTALL%\py\cython
%DHINSTALL%\py\cython\Scripts\activate.bat
```
Then run
```sh
pip3 install cython
```
#### Build the shared library (Linux version)
```sh
cd ${DHROOT}/py/client-ticking
```
```sh
# 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) CPPFLAGS="-I${DHCPP}/include" LDFLAGS="-L${DHCPP}/lib" python3 setup.py build_ext -i
```
#### Build the shared library (Windows version)
```bat
cd %DHSRC%\py\client-ticking
```
```sh
rem Ensure we clean the remnants of any pre-existing build.
rmdir build dist /s /q
rem replace the value below to the version you are building
set DEEPHAVEN_VERSION=0.37.0-SNAPSHOT
python setup.py build_ext -i
```
#### Install pydeephaven-ticking
In linux, build the wheel with
```sh
DEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) python3 setup.py bdist_wheel
```
In windows, use
```bat
rem ensure you have %DEEPHAVEN_VERSION% defined with the right value
python setup.py bdist_wheel
```
Then install the package.
Note: the actual name of the `.whl` file may be different depending on system details.
On Linux:
```sh
pip3 install --force --no-deps dist/pydeephaven_ticking-<x.y.z>-cp310-cp310-linux_x86_64.whl
```
On Windows:
```bat
pip3 install --force --no-deps dist\pydeephaven_ticking<x.y.z>-cp312-cp312-win_amd64.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 tests
``` shell
$ python3 -m unittest discover tests
```
### Sample Python program
Run python from the venv while in this directory, and try this sample Python program:
``` python
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()
```
Raw data
{
"_id": null,
"home_page": "https://deephaven.io/",
"name": "pydeephaven-ticking",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Deephaven Data Labs",
"author_email": "python@deephaven.io",
"download_url": null,
"platform": null,
"description": "# Deephaven Python Ticking Package\n\nThe `pydeephaven-ticking` package enables access to ticking Deephaven data from Python. It extends\nthe functionality of the pydeephaven package to add the ability to subscribe to tables and receive\nchange notifications containing added, removed, and modified data. It uses Cython to create a thin\nwrapper around Deephaven's C++ library.\n\n## Prerequisites\n\nThe Deephaven C++ client (and ticking Python client) are tested regularly on Ubuntu 22.04 x86_64.\nAdditionally, successful tests have been run on RHEL 8 and Fedora 38 (both on x86_64).\nWindows support is expected to be made available in the future.\n\n## Installation\n\n`pydeephaven-ticking` can be installed with `pip` or by building from source.\n\n## `pip`\n\nA Linux operating system on x86_64 architecture or Windows 10 64 bits is requi!red to install via `pip`.\nIt's recommended to install this way in a Python virtual environment (venv).\n\n```sh\npip install pydeephaven-ticking\n```\n\n## Build from source\n\nIf building from source, `pydeephaven-ticking` also requires a working installation of the C++\nclient. All four packages (Deephaven Core, `pydeephaven`, `pydeephaven-ticking`, and the Deephaven \nC++ client) are present in the [deephaven-core](https://github.com/deephaven/deephaven-core) \nrepository. It is assumed that you have the repository checked out at the location specified by \n`${DHROOT}` (for Linux) or `%DHSRC%` (for Windows).\n\n### Install the C++ client\n\nFirst, install the Deephaven C++ client. Follow the instructions in `$DHROOT/cpp-client/README.md`\n(for Linux) or `%DHSRC\\cpp-client\\README.md` (for Windows).\nNote the restrictions on supported platforms mentioned there. The instructions will ask you to\nselect a location for the installation of the C++ client library and its dependencies.\n\nAccording to the C++ build instructions, and depending on platform,\nthe location is specified in an environment variable as follows:\n\n* On Linux: the location is specified in the `${DHCPP}` environment variable.\n* On Windows: the location is specified in the `%DHINSTALL%` environment variable.\n\n### Install pydeephaven\n\nTo install pydeephaven, follow the instructions in `${DHROOT}/py/client/README.md` (on Linux)\nor `%DHSRC%\\py\\client\\README.md` (on Windows).\n\nThese instructions will require you to create a Python venv. After installing that package,\nyou will continue to use that venv here.\n\n### Build the ticking Python client\n\n#### Install Cython in the venv\n\nIf you've exited your venv, re-activate it.\n\nFor Linux: \n\n```sh\n# This assumes your venv is in $HOME/py/cython\nsource ~/py/cython/bin/activate\n```\n\nFor Windows\n```bat\nrem This assumes your venv is in %DHINSTALL%\\py\\cython\n%DHINSTALL%\\py\\cython\\Scripts\\activate.bat\n```\n\nThen run \n\n```sh\npip3 install cython\n```\n\n#### Build the shared library (Linux version)\n\n```sh\ncd ${DHROOT}/py/client-ticking\n```\n\n```sh\n# Ensure the DHCPP environment variable is set per the instructions above\nrm -rf build dist # Ensure we clean the remnants of any pre-existing build.\nDEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) CPPFLAGS=\"-I${DHCPP}/include\" LDFLAGS=\"-L${DHCPP}/lib\" python3 setup.py build_ext -i\n```\n\n#### Build the shared library (Windows version)\n\n```bat\ncd %DHSRC%\\py\\client-ticking\n```\n\n```sh\nrem Ensure we clean the remnants of any pre-existing build.\nrmdir build dist /s /q\nrem replace the value below to the version you are building\nset DEEPHAVEN_VERSION=0.37.0-SNAPSHOT\npython setup.py build_ext -i\n```\n\n#### Install pydeephaven-ticking\n\nIn linux, build the wheel with\n\n```sh\nDEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) python3 setup.py bdist_wheel\n```\n\nIn windows, use\n```bat\nrem ensure you have %DEEPHAVEN_VERSION% defined with the right value\npython setup.py bdist_wheel\n```\n\nThen install the package.\nNote: the actual name of the `.whl` file may be different depending on system details.\n\nOn Linux:\n\n```sh\npip3 install --force --no-deps dist/pydeephaven_ticking-<x.y.z>-cp310-cp310-linux_x86_64.whl\n```\n\nOn Windows:\n```bat\npip3 install --force --no-deps dist\\pydeephaven_ticking<x.y.z>-cp312-cp312-win_amd64.whl\n```\n\nThe `--force` flag is required to overwrite any previously-built version of the package that might\nalready be there. The `--no-deps` flag ensures that we are sure to refer to the `pydeephaven`\npackage just built from the above steps, rather than one from PyPi.\n\n## Testing the library\n\n### Run tests\n``` shell\n$ python3 -m unittest discover tests\n\n```\n\n### Sample Python program\n\nRun python from the venv while in this directory, and try this sample Python program:\n\n``` python\nimport pydeephaven as dh\nimport time\nsession = dh.Session() # assuming Deephaven Community Core is running locally with the default configuration\ntable = session.time_table(period=1000000000).update(formulas=[\"Col1 = i\"])\nlistener_handle = dh.listen(table, lambda update : print(update.added()))\nlistener_handle.start()\n# data starts printing asynchronously here\ntime.sleep(10)\nlistener_handle.stop()\nsession.close()\n```\n",
"bugtrack_url": null,
"license": "Deephaven Community License Agreement Version 1.0",
"summary": "The Deephaven Python Client for Ticking Tables",
"version": "0.37.1",
"project_urls": {
"Homepage": "https://deephaven.io/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "20ffb87bfcc0848c3b23e1387613cbf089fff5133adc938ee9499c4aeb87706c",
"md5": "5092b24592efb3e8ef46c3491e310f2d",
"sha256": "5c45119de861459e0491d9d2135ebe058c1e18929bfc7bae44cadcf6ed7a0ba3"
},
"downloads": -1,
"filename": "pydeephaven_ticking-0.37.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "5092b24592efb3e8ef46c3491e310f2d",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 12209982,
"upload_time": "2024-12-12T21:12:00",
"upload_time_iso_8601": "2024-12-12T21:12:00.541604Z",
"url": "https://files.pythonhosted.org/packages/20/ff/b87bfcc0848c3b23e1387613cbf089fff5133adc938ee9499c4aeb87706c/pydeephaven_ticking-0.37.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9d173b131abe4aa9cded381bd8423d6a5b3867a42b36990b3c1e59bcd0c2d4d5",
"md5": "9be2c6a269508475c7fb587c617d63bb",
"sha256": "c7baadd04d40a7e7de6406d4069324598fda58f8f535a96a306dfadc792df5d8"
},
"downloads": -1,
"filename": "pydeephaven_ticking-0.37.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "9be2c6a269508475c7fb587c617d63bb",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 12258853,
"upload_time": "2024-12-12T21:12:05",
"upload_time_iso_8601": "2024-12-12T21:12:05.802833Z",
"url": "https://files.pythonhosted.org/packages/9d/17/3b131abe4aa9cded381bd8423d6a5b3867a42b36990b3c1e59bcd0c2d4d5/pydeephaven_ticking-0.37.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dcc130296167890907c68900115abc1223816b6af673c21b80e0da837e465372",
"md5": "a0fb5a3ae557ffaa9acb5a73cc6ee2de",
"sha256": "00a4ed9e2459aa45aa62ec45b12da27ab6b98718e425aceb08ea0d9ce5d8ac03"
},
"downloads": -1,
"filename": "pydeephaven_ticking-0.37.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a0fb5a3ae557ffaa9acb5a73cc6ee2de",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 12231410,
"upload_time": "2024-12-12T21:12:12",
"upload_time_iso_8601": "2024-12-12T21:12:12.410556Z",
"url": "https://files.pythonhosted.org/packages/dc/c1/30296167890907c68900115abc1223816b6af673c21b80e0da837e465372/pydeephaven_ticking-0.37.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "798d03e9fef0f53afe49e20114894465c459f14cb577da5439280147eebdea84",
"md5": "35b1333540570c84da407db16d967ea8",
"sha256": "3338fac6ac6242b2bcaa72de0d491039ed9d8b44bd4f5445fbe847a5764836ff"
},
"downloads": -1,
"filename": "pydeephaven_ticking-0.37.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "35b1333540570c84da407db16d967ea8",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 12236606,
"upload_time": "2024-12-12T21:12:18",
"upload_time_iso_8601": "2024-12-12T21:12:18.507738Z",
"url": "https://files.pythonhosted.org/packages/79/8d/03e9fef0f53afe49e20114894465c459f14cb577da5439280147eebdea84/pydeephaven_ticking-0.37.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "991920162e5c2af8d169f9f832606a8b109b35eaac6e5a103c57e0677e023bc9",
"md5": "4e19b2a970007f78921c6ee1bd106bb1",
"sha256": "df122c937978f5472709477410a72d3f1fb9789f1424928acb804ed87a50d474"
},
"downloads": -1,
"filename": "pydeephaven_ticking-0.37.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "4e19b2a970007f78921c6ee1bd106bb1",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 12211088,
"upload_time": "2024-12-12T21:12:21",
"upload_time_iso_8601": "2024-12-12T21:12:21.939559Z",
"url": "https://files.pythonhosted.org/packages/99/19/20162e5c2af8d169f9f832606a8b109b35eaac6e5a103c57e0677e023bc9/pydeephaven_ticking-0.37.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 21:12:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pydeephaven-ticking"
}