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 a Core in Synnax Enterprise, or to Synnax Desktop on the same computer. 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:
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, andRate, with nanosecond precision.
Operations
Each operation is a method on the client.
Languages
Use a client with the same major and minor version as your Core, such as client 0.58 with Core 0.58. The client prints a warning when the versions differ.