Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

API package for StreamSQL

Project description


The Python API for StreamSQL enables developers to interact with their StreamSQL instance. StreamSQL is a unified data pipeline for ML feature engineering and input serving. It abstracts batch and streaming data under one interface to allow your ML data scientists to add, update, and remove input features using only SQL, Tensorflow, or custom Python functions. It works in both training and serving environments and includes stateful storage for ML primitives like embeddings, and native integrations into Tensorflow.

Getting Started

The StreamSQL Python API provides tools to interact with the Client and Execution environments of StreamSQL. This includes creating, deleting, and inspecting tables, streams, and transformations, as well as data ingestion and retrieval.



StreamSQL API requires Python 3. It has been tested with Python v3.5.


If you haven't already created a StreamSQL instance, you can signup and create one here


You can install the StreamSQL API with pip

pip install streamsql


Below are some example use cases for the StreamSQL API


Sending Data

from streamsql import SimpleClient

# Create a Client object to interact with the client environment
client = SimpleClient(APIKEY)

# Example Event
event = {
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "username": "john_smith"
    "action": "Login",
    "timestamp": "2020-02-20T21:39:18+00:00"

# Put the event into an immutable data stream
client.send('MyStream', event)

# Fetch the last login of "john_smith" from a lookup table
client.lookup('LastLogin', 'john_smith')

Transforming Data

from streamsql import SimpleClient, FieldTypes

# Create a Execution object to interact with the execution environment
exc = SimpleClient(APIKEY)

# Register a stream named "MyStream"

# Register a lookup named "LastLogin"
    .source("MyStream")             # Set the data source and type
    .extract("user.username", "username", "STRING")   # Extract a field from the JSON object and provide an alias and type  
    .extract("timestamp", "ts", "TIMESTAMP")          
    .query("SELECT username, ts FROM MyStream")                             # Use SQL query to generate results

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for streamsql, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size streamsql-1.0.4-py3-none-any.whl (16.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size streamsql-1.0.4.tar.gz (10.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page