v0.62.0
ReferenceClient libraries

Client libraries

Learn what the Python and TypeScript client libraries do, how they shape data, and which operation to use.

The Synnax client libraries connect your own Python and TypeScript code to a Synnax Core. Use them to write, read, stream, and delete the samples of channels, and to set up channels, ranges, and tasks from code. The clients connect to Synnax Desktop on the same computer, or to a Core in Synnax Enterprise. To start, follow the quick start.

In code, samples move in series and frames. A series holds the samples of one channel. A frame holds one or more series, keyed by channel:

tank_timeindex channel
tank_pressuredata channel
Seriestimestamps
Seriesfloat32 values
Framekeyed by channel
tank_timeindex channel
tank_pressuredata channel
Seriestimestamps
Seriesfloat32 values
Framekeyed by channel

What the client libraries are for

Analyze test data

Read the samples of a test run into a pandas DataFrame or a NumPy array, then analyze and plot them with the tools you already use. See Read data.

Show live data in your own app

A streamer gets each sample as it arrives. Use it to show live values in a web page, send them to another system, or check them in a test script.

Record data from a script

A writer stores samples from a source that Synnax has no integration for: an instrument on a serial port, a simulation, or a file. To make the source a device in the Console, build a custom device.

Automate a test from Python

A Python control sequence reads sensors, commands valves, and waits for conditions. See Python control sequences.

Configure Synnax from code

Create many channels, ranges, and tasks with one script, and run it again on each new Core. Each capability page has Python and TypeScript tabs, for example Create channels and Create ranges.

Process data as it arrives

Stream samples from some channels, compute new values, and write them to other channels. Use code when the work needs a library, a file, or another system. For math on channels in the Core, a calculated channel needs no code.

Data in code

  • Samples -> the values of a channel, each at one point in time.
  • Series -> the samples of one channel, as a typed array.
  • Frame -> the series of one or more channels, keyed by channel.
  • Time types -> TimeStamp, TimeSpan, TimeRange, and Rate, with nanosecond precision.

Operations

Operation Python TypeScript Use it to
Write open_writer, write openWriter, write Store samples and stream them live.
Read read, read_latest, open_iterator read, readLatest, openIterator Get samples that the Core stored.
Stream open_streamer, open_async_streamer openStreamer Get samples as they arrive.
Delete delete delete Remove the samples in a time range.
Export read_csv, read_tdms readCSV, readTDMS Save samples to a CSV or TDMS file.

Each operation is a method on the client.

Languages

Language Package Runs on
Python synnax on PyPI Python 3.13 or later on Linux, macOS, or Windows
TypeScript @synnaxlabs/client on npm Node.js 22.12 or later, a browser, Deno, or Bun

The TypeScript client is an ES module only. It works the same in Node.js and in a browser.

The Python client follows SPEC 0, the support schedule of NumPy, pandas, and SciPy. Each Python version gets support for three years after its first release. The client supports Python 3.13, 3.14, and 3.15.

Use a client with the same major and minor version as your Core, such as client 0.61 with Core 0.61. The patch version can differ. When the major or minor version differs, the client prints a warning. When the TypeScript client cannot read the replies of the Core, its connection status shows Core version not supported.

The Python client is pure Python. It installs on each computer where its dependencies, such as numpy, pandas, and pydantic, have wheels. This includes Linux on ARM, such as a Raspberry Pi or an NVIDIA Jetson, where no Core or Driver runs.

The Python client also runs on free-threaded Python 3.14t and later, which has no global interpreter lock, so its threads run in parallel.

TypeScript client support

The TypeScript client supports:

  • Node.js -> each line in Active or Maintenance LTS: today 22, 24, and 26. On line 22, use 22.12 or later, the first release that can require() an ES module. When Node.js ends support for a line, the next client release drops it.
  • TypeScript -> each version less than two years old. Set moduleResolution to bundler or nodenext, and set lib and target to ES2024 or later.
  • Browsers -> each version that is Baseline Widely available, and at least Chrome 122, Firefox 127, or Safari 17.4.
  • Deno and Bun -> the latest stable release. Deno needs the --allow-net flag.