Skip to content

Real-Time Streaming

This is an example scipt to show the user how to connect and retrieve the data from the sensors deployed along CUIP's Smart Corridor. The script starts by connecting to CUIP’s SDSM stream and prints incoming messages in real time.

import cuip
import asyncio

def process(data):
    print(data)

asyncio.run(
    cuip.Streams("api-key").process_ws_stream(
        process, "sdsm-events"
    )
)