Skip to main content

Overview

This tutorial shows how to stream telemetry from a Python script to Sift using the Sift Python client library. You will install the client library, configure authentication, define telemetry signals, and send time-series data to Sift from a Python script.

Prerequisites

Scenario

Imagine a robotic vehicle that continuously reports telemetry such as velocity and internal temperature. In this tutorial, a Python script simulates the system by generating these measurements every 0.5 seconds.

Step 1: Obtain the Python example project

Clone the Sift repository and navigate to the directory that contains the Python streaming ingestion example used in this tutorial, including the script and a requirements.txt file that lists the dependencies required to run it.
git clone https://github.com/sift-stack/sift.git
cd sift/python/examples/ingestion-tutorial

Step 2: Install the Python dependencies

From a Python environment, run the following command to install the dependencies required for the Python streaming ingestion example:
pip install -r requirements.txt

Step 3: Configure authentication

Create a .env file and add your Sift API key along with your Sift gRPC and REST URLs:
touch .env
SIFT_API_KEY=your_api_key_here
SIFT_GRPC_URL=https://your-grpc-url
SIFT_REST_URL=https://your-rest-url

Step 4: Run the example and view streamed data in Sift

Run the Python script to start streaming telemetry to Sift. The script runs continuously until you stop it (for example, with Ctrl+C), and the telemetry appears live in Explore v2 (Beta):
python stream.py
  1. Check the terminal for the generated Run name (for example, robot_vehicle_…_run). Then, in Sift, locate the Run name or description field and enter that name.
  2. Click Explore.
  3. Click Live.
  4. In the Channels tab, select the following Channels:
    • temperature
    • velocity

Step 5: Understand the ingestion workflow

The ingestion process follows a clear sequence. The steps below summarize how telemetry is structured, configured, and streamed to Sift.
1

Authentication and telemetry structure

  • At a high level, streaming telemetry to Sift involves defining structure first, then sending timestamped data that conforms to that structure.
  • In this script, authentication is configured using SiftConnectionConfig, and a SiftClient is created to communicate with your Sift environment.
2

Telemetry schema definition

  • A FlowConfigPy defines the telemetry schema, and each ChannelConfigPy declares an individual signal with its name, unit, and data type.
  • These types are used directly from sift_stream_bindings to avoid the CPU-bound overhead of the ergonomic Python type conversions.
Performance: Using sift_stream_bindings types directly avoids the CPU-bound bottlenecks that occur when converting between Flow and FlowPy types.
3

Ingestion context setup

  • An IngestionConfigFormPy associates that schema with an Asset, and a RunCreate defines the session that will group all incoming telemetry.
4

Streaming telemetry ingestion

  • Once this ingestion context is established, the script opens a streaming ingestion session over gRPC and begins sending timestamped flows in real time.
  • Each flow is constructed directly as a FlowPy object using ChannelValuePy, ValuePy, and TimeValuePy from sift_stream_bindings, ensuring the data matches the defined schema. These flows are transmitted over the open stream and immediately appear in Sift under the specified Run.
Performance: ingest_client should be opened once and reused for the entire duration of your program. Recreating it per batch or per iteration creates a new ingestion config each time, which introduces significant performance overhead.

Conclusion

In this tutorial, you cloned a Python example project, installed its dependencies, configured authentication, and streamed telemetry to Sift using the Sift Python client library. You also viewed the live telemetry in Explore v2 (Beta) and saw how streaming ingestion sends structured time-series data to Sift in real time.