Skip to main content

Real-time SQL computation engine for streaming numerical data

Project description

RtBot SQL

Real-time SQL computation engine for streaming numerical data. Write SQL to define streaming pipelines — RtBot compiles them into high-performance C++ programs that process data incrementally, one message at a time.

Quick start

import math
from rtbot_sql import RtBotSql

sql = RtBotSql()
sql.configure_time_format(formatter=lambda ts: ts)

sql.execute("CREATE STREAM sensors (temperature DOUBLE)")
sql.execute("""
  CREATE MATERIALIZED VIEW stats AS
    SELECT temperature,
           MOVING_AVERAGE(temperature, 50) AS avg_temp,
           MOVING_STD(temperature, 50) AS std_temp
    FROM sensors
""")

# Generate 200 readings: smooth sine wave with 3 injected spikes
readings = []
for i in range(200):
    temp = 20.0 + 2.0 * math.sin(i * 2 * math.pi / 60) + 0.3 * math.sin(i * 7.1)
    if i == 80:
        temp = 35.0   # spike high
    elif i == 130:
        temp = 5.0    # spike low
    elif i == 170:
        temp = 38.0   # spike high
    readings.append({"time": i, "temperature": temp})

sql.insert_dataframe("sensors", readings)

# Query only the anomalies
result = sql.execute("""
  SELECT * FROM stats
  WHERE ABS(temperature - avg_temp) > 2 * std_temp
""")

for col in result["columns"]:
    print(f"{col:>15}", end="")
print()
for row in result["rows"]:
    for val in row:
        print(f"{val:>15.2f}", end="")
    print()

Output:

    temperature       avg_temp       std_temp
          35.00          20.10           2.61
           5.00          19.27           2.39
          38.00          20.23           3.65

See the full documentation for more examples and the SQL reference.

With pandas

from rtbot_sql import RtBotSql
import pandas as pd

sql = RtBotSql()
sql.execute("CREATE STREAM sensors (temperature DOUBLE, pressure DOUBLE)")
sql.execute("""
  CREATE MATERIALIZED VIEW alerts AS
    SELECT temperature, pressure,
           MOVING_AVERAGE(temperature, 50) AS avg_temp,
           MOVING_STD(temperature, 50) AS std_temp
    FROM sensors
    WHERE ABS(temperature - MOVING_AVERAGE(temperature, 50)) > 2 * MOVING_STD(temperature, 50)
""")

df = pd.read_csv("sensor_history.csv")
sql.insert_dataframe("sensors", df)
results = sql.execute("SELECT * FROM alerts")

Features

  • One language, all stages — the SQL you write in a notebook is the same SQL that runs in production
  • Incremental execution — each new data point updates pipeline state in constant time
  • Deterministic — same input always produces the same output, regardless of timing
  • High performance — native C++ engine with Python bindings via pybind11

Documentation

License

Proprietary. See rtbot.dev for licensing options.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rtbot_sql-0.1.15-cp314-cp314-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.14Windows x86-64

rtbot_sql-0.1.15-cp314-cp314-manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.1.15-cp314-cp314-manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.1.15-cp314-cp314-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

rtbot_sql-0.1.15-cp314-cp314-macosx_10_14_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.14macOS 10.14+ x86-64

rtbot_sql-0.1.15-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

rtbot_sql-0.1.15-cp313-cp313-manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.1.15-cp313-cp313-manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.1.15-cp313-cp313-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rtbot_sql-0.1.15-cp313-cp313-macosx_10_14_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

File details

Details for the file rtbot_sql-0.1.15-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rtbot_sql-0.1.15-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rtbot_sql-0.1.15-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 dc9a840c17521be5990ef24a11372f08b4be8fe13ddca703f3781dbe615c980b
MD5 3341989b07bdeb7e7684acbf007b310e
BLAKE2b-256 6577d30be990e93a71556b1728ee74047ab8e1aea11dad805b3dacc55273d2b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp314-cp314-win_amd64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp314-cp314-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9db568357f86a8eb78aac61049ca2a02f1bc8ec8716905b89301e5eae4bbae61
MD5 2c469f086f7498b396f306591b751a61
BLAKE2b-256 47cbe24a21e9f5b4b22580e186fc76dec7536557425a39f998688609ba75d523

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp314-cp314-manylinux2014_x86_64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp314-cp314-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f6ff85b4c930c599bf5bfc3ab2fc9ea7d00bbd7d4672ca9657af57ac2ae22194
MD5 03fed6b3ae4067a2a82f6320fc39c1dd
BLAKE2b-256 e992b53f437b1037bcdb471db1b60ec64c82306f16df760f1d8442adbf7e6691

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp314-cp314-manylinux2014_aarch64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0b045016ebce8ccb9f05836f3d0e4c302de99e40d16846c1563be341b981b44
MD5 28f2131e6366db6ff08162ca5ba3bb56
BLAKE2b-256 7ee04e5f250093c3400a986652e73c75f32148a05c0f6b9e5720eb9d3761a309

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp314-cp314-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp314-cp314-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e0a21c56c759fb35ba336e8e0970e1bf1629f68cf92929036cc31c60484e47d5
MD5 47327da367c3d90b2f54810ba0d6a5f9
BLAKE2b-256 d35ad2926ab1518d2318017f4971b159c0391cd25ce13bf0cdc03b46487e95d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp314-cp314-macosx_10_14_x86_64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rtbot_sql-0.1.15-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rtbot_sql-0.1.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6852bd724c7228d7937e01ed6ce79bcb55ea13ee5d0e957a1bb57d4e14c3822e
MD5 e63dc91c6afb1947eb80cea96440ef4c
BLAKE2b-256 372ed1058366355497ae3618d9cb115327ec6fe56d149ad148e9f9aa519fcf30

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp313-cp313-win_amd64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5f61e037ff7aa566575ac67bea9b921f21d7ada64a7db204eee48c9bdeeaedf1
MD5 f0c109690ebed201dde40789a524f9e1
BLAKE2b-256 9f06e16e2161edef46accdd9c9a3fbfc706da6f4f4f436738fc47f6e4da93cf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp313-cp313-manylinux2014_x86_64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c48e0de430cdcbf7d7319ad2fec1304e03dc29b4e482f96cf36b13ac62731573
MD5 6a5d91838d02d8d2f7936729c72017ea
BLAKE2b-256 4968af9db7ae7ccf71f2d791dadc081c8f37d42be26b9a43c818b4195ba4fadc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp313-cp313-manylinux2014_aarch64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6787ef9132464291d6dea351246983e0e6ee7eca7a06301dcbb60bf71b4dd76a
MD5 532d603785d6d91e0ba8864018205ba7
BLAKE2b-256 fa496f1129a01974c5fadd35b17445c697500e0b5aaf438e3b2b423beff899c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbot_sql-0.1.15-cp313-cp313-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.1.15-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 cc0a6b79dee9bba63ee248af068c989794908f82a9b941fd802570c1674a9d72
MD5 673853efb17a9f209955bfa3bcf11f80
BLAKE2b-256 103df5627154db2d0c25addf479e952f99466fbfa87562dea125a3f2a8e66812

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.1.15-cp313-cp313-macosx_10_14_x86_64.whl:

Publisher: release.yaml on rtbot-dev/rtbot-sql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page