Local development with Deephaven libraries

This guide explains how to build Python projects that use Deephaven tables locally. This is useful for creating utilities, custom functions, or data pipelines that work with Deephaven tables outside of the Deephaven IDE.

Set up your project

Install deephaven-server to use Deephaven tables in your Python project:

Note: deephaven-server requires Java 17+ and sets up an embedded Deephaven server. Set your JAVA_HOME environment variable before running.

Use casePackage
Connect to a remote Deephaven serverpydeephaven
Read/write Parquet filesdeephaven.parquet module (included with deephaven-server)
NumPy integrationnumpy (included with deephaven-server)
Pandas integrationpandas (included with deephaven-server)

Local unit testing

To use Deephaven table operations in unit tests, start an embedded server before importing Deephaven modules.

pytest setup

Install pytest alongside deephaven-server:

Create a conftest.py file in your test directory to start the server once for all tests:

Note: The server must start before any deephaven imports. Since pytest loads conftest.py before collecting test modules, starting the server at module level ensures the JVM is ready when test files import deephaven.

Example tests

Run tests with:

Testing ticking tables

When testing with time_table or other ticking tables, use await_update to wait for updates:

Testing with a remote server

If your code connects to a remote Deephaven server, use pydeephaven:

See Python Client Quickstart for full setup instructions.

Reading test data

Load test data from CSV or Parquet files:

See read_csv and read for more options.

Project structure

A typical project structure:

Example pyproject.toml