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-serverrequires Java 17+ and sets up an embedded Deephaven server. Set yourJAVA_HOMEenvironment variable before running.
Related packages
| Use case | Package |
|---|---|
| Connect to a remote Deephaven server | pydeephaven |
| Read/write Parquet files | deephaven.parquet module (included with deephaven-server) |
| NumPy integration | numpy (included with deephaven-server) |
| Pandas integration | pandas (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
deephavenimports. Since pytest loadsconftest.pybefore collecting test modules, starting the server at module level ensures the JVM is ready when test files importdeephaven.
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: