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.4.1-cp314-cp314-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.14Windows x86-64

rtbot_sql-0.4.1-cp314-cp314-manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.4.1-cp314-cp314-manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.4.1-cp314-cp314-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

rtbot_sql-0.4.1-cp314-cp314-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14macOS 10.14+ x86-64

rtbot_sql-0.4.1-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

rtbot_sql-0.4.1-cp313-cp313-manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.4.1-cp313-cp313-manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.4.1-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rtbot_sql-0.4.1-cp313-cp313-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rtbot_sql-0.4.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1d35db7057fa8441c8e73106eb9960858ff60264a000c5ccec588b4d27ed2ecb
MD5 d1e74a9ddc994b2d7cc755d7f21a43cb
BLAKE2b-256 a600ea7b20dea705581cf230ed0fa8ad7d0bbcd64bfb45821b5a40feb1a4ecfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp314-cp314-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f3e025e36fc48a8bdd6134fd0e339065912a8d8ccc2dabf3cd998fbf6c919dc
MD5 a38432d139bb105574ee4a9e81ab17fa
BLAKE2b-256 fb1fb7863ba99ad78ec7c1618e34e397d9889846ca2b0faabc03170c2ef90919

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp314-cp314-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d41758ce251e6a95d599ed7dc3a2ecb45880846f3451a843bf47ebce244cbbad
MD5 dab022b2cc000522750acaf76aca6321
BLAKE2b-256 63cbf46ed53f13ab6284f337c736c8d7b50f95fc679d057895022cff2b513e4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a51f669500dbb259222c7be862a4a784d0b3c8821d38282a680f4c5eeb5edf63
MD5 487f2db7e0133991f281af7aba441679
BLAKE2b-256 950580012727c01bb0b9f4f5025596e06785b6532be36cc49a26b4030d559ccf

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp314-cp314-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp314-cp314-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5a1db03c69b0f319f353d89f3372df1bb30f02b7a6bada37a1e98cd00329eb7c
MD5 88dd0819fb770eb13286c625e51a68c1
BLAKE2b-256 b2a17552ee986f59a8621410a60fde884aeeaae473f5efdc648471ebdba83ee4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp313-cp313-win_amd64.whl.

File metadata

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

File hashes

Hashes for rtbot_sql-0.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe94e058fd175347c394cc65a537f3c5aee7b131b9424ac32df6226afebf5728
MD5 f85018d467e5c5ba09751f4fc2e085ee
BLAKE2b-256 2e158cda57e2eb2578a787bc08f694705a8e0d8cce1295d16baaf1d6a0b12719

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d74e63a9c29eff3cdf382f875d27eb5b813ccf06abcddb76d400b32771cbb05e
MD5 2fd659375e7e3e1d67faa925a55798a9
BLAKE2b-256 4ef428960b3e0c2d5dbd46cef8bdf8a9260bf13d7fe8c6b64b0c42477fd4a1fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2a1efd3b764a972ea8ba2c780698e9eb566fc353e5b7f1bf9ca7a0c62ad17a9f
MD5 4589697ed0062a819022671e00802760
BLAKE2b-256 70e106d5617e118eb310f6ae5d1e696655a6c8caf36814d438ef0b1c9d2b387e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e998017470e27d9e4ef6d4a193bca9d83547bf76deac66f9ff3f7ad951fd2114
MD5 6260ab35e3bcdaaab0be8739da2408b1
BLAKE2b-256 9e2eca544005fb3a2ee2354b1e1fda3c4ef67a33796bba772883325d38ea8653

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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.4.1-cp313-cp313-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for rtbot_sql-0.4.1-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5855fe77b90b265cd80d8c0c6534901efbfa2a297334c4c3a2270e23581578e7
MD5 5584de4085298cfca26b1b3ecc335018
BLAKE2b-256 38d4412698975ca84116cb4aea37aaf9fa70b753c84046847c77d97fa0bab4b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbot_sql-0.4.1-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