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
- Basic understanding of how Assets, Channels, and Runs relate to each other in Sift
- Working knowledge of Python and familiarity with
async/await - A Sift API key and your Sift gRPC and REST base URLs
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 arequirements.txt file that lists the dependencies required to run it.
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:Step 3: Configure authentication
Create a.env file and add your Sift API key along with your Sift gRPC and REST URLs:
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):- 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.
- Click Explore.
- Click Live.
- 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.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 aSiftClientis created to communicate with your Sift environment.
Telemetry schema definition
- A
FlowConfigPydefines the telemetry schema, and eachChannelConfigPydeclares an individual signal with its name, unit, and data type. - These types are used directly from
sift_stream_bindingsto avoid the CPU-bound overhead of the ergonomic Python type conversions.
Ingestion context setup
- An
IngestionConfigFormPyassociates that schema with an Asset, and aRunCreatedefines the session that will group all incoming telemetry.
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
FlowPyobject usingChannelValuePy,ValuePy, andTimeValuePyfromsift_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.