> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting started with streaming data to Sift using Python

> Learn how to send live telemetry from a Python script to Sift and view it in real time

## Overview

This tutorial shows how to stream telemetry from a Python script to Sift using the [Sift Python client library](https://sift-stack.github.io/sift/python/latest/).
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](../../documentation/ingest/stream/organize-streamed-data-into-assets-and-runs), [Channels](../../documentation/reference/channels-reference), and [Runs](../../documentation/reference/runs-reference) relate to each other in Sift
* Working knowledge of Python and familiarity with `async` / `await`
* A Sift [API key](../../documentation/manage/set-up-api-access) and your Sift [gRPC and REST base URLs](../../documentation/manage/set-up-api-access)

## 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.

```bash theme={null}
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:

```bash theme={null}
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:

```bash id="v9s3dk" theme={null}
touch .env
```

```bash id="8b2c6p" theme={null}
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](/documentation/reference/explore-settings):

```bash theme={null}
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 <Icon icon="arrow-up-right-from-square" /> **Explore**.
3. Click <Icon icon="dot" /> **Live**.
4. In the <Icon icon="wave-pulse" /> **Channels** tab, select the following Channels:
   * <Icon icon="hashtag" /> **temperature**
   * <Icon icon="hashtag" /> **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.

<Steps>
  <Step title="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.
  </Step>

  <Step title="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.

    <Warning>
      **Performance**: Using `sift_stream_bindings` types directly avoids the CPU-bound bottlenecks that occur when converting between `Flow` and `FlowPy` types.
    </Warning>
  </Step>

  <Step title="Ingestion context setup">
    * An `IngestionConfigFormPy` associates that schema with an Asset, and a `RunCreate` defines the session that will group all incoming telemetry.
  </Step>

  <Step title="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.

    <Warning>
      **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.
    </Warning>
  </Step>
</Steps>

## 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 and saw how streaming ingestion sends structured time-series data to Sift in real time.
