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.3.0-cp314-cp314-win_amd64.whl (982.9 kB view details)

Uploaded CPython 3.14Windows x86-64

rtbot_sql-0.3.0-cp314-cp314-manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.3.0-cp314-cp314-manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.3.0-cp314-cp314-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

rtbot_sql-0.3.0-cp314-cp314-macosx_10_14_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 10.14+ x86-64

rtbot_sql-0.3.0-cp313-cp313-win_amd64.whl (982.5 kB view details)

Uploaded CPython 3.13Windows x86-64

rtbot_sql-0.3.0-cp313-cp313-manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.3.0-cp313-cp313-manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rtbot_sql-0.3.0-cp313-cp313-macosx_10_14_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: rtbot_sql-0.3.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 982.9 kB
  • 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.3.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 15365ed948bffe0e201e29207716db38725d45c348bd9ea13b4b2a81f6d8e524
MD5 5912264e2eb880509229b113530fb767
BLAKE2b-256 116fd3428540b9fa0b5d4d4734612aa14516679666a5f703deb9836a0d69f19a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8fa2f77b844ca08899eb07472115980f842f37c8bcaabadd68c408e5c51930cd
MD5 90ac39a9bb4b28241778275fb5c6d9ee
BLAKE2b-256 681e6ee07ce83e9b26b2007eb29f5d43ee83a390a354fbfa157e78ec6cf61ebb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 97ace819e48b10255a37ce3d283e47b16d061af9c46218e7179223cb5bc59402
MD5 268603ce6eea9263865ce79afa63a891
BLAKE2b-256 ef56030fe47120dfa349a6f7326187a855d079346049020003ad02da672a6501

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b4c1c4ac14fc3ba54dc355e87f89ab3fa179092857c80ae472c9c4084f755f2
MD5 1d68b63b6fb2dfecbc065ff920117b3d
BLAKE2b-256 f1060cdfefdc6314352732855efe504140c77c09e60848f25b369153ed638886

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp314-cp314-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 cadcfd87b032350b3e719987870f36f79af675afd434a735db6b1698d18ab289
MD5 55fa9839a018bf5793a70a8dfd34bc39
BLAKE2b-256 94422ae77dcd3d0cbe7df865f5f92597a9b68de9b544f94208242036d259aaf3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rtbot_sql-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 982.5 kB
  • 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.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9900fe7325078587ca95eaf02ee7094413d286260b991be8620450a7ba88bd8d
MD5 839cf5237ef92a7c4129bf271d527bec
BLAKE2b-256 5b25bc3ccf7963e2b074d4c96dc853591f6d275c745ec408348347f437f89ff6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea887ae13f3bd6aab4fb9c9b1a44946e22fcb55a989e5985952bd4a5e5f38e46
MD5 1af5894588777c81e7d36a79547e572a
BLAKE2b-256 5fd06c9d6f66a93ee0b7a91c2c63604c91d9850abbd09f68e9ca1d6f884237fb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cee4e9831694515695f8ff64ccf20347b0d325bd0011ec17f6d2690207d60093
MD5 fc1a5cf3b522032252f8394b30950a0a
BLAKE2b-256 8a33bef785a1e246d124a06ad2debee21a8a33f6b12a595f291411f73864b4e6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00ef72787b6382254448a7fa6806829fff1f73846a226f91d4f2407589d1a30f
MD5 ec5c6d81101a98877e1bad5e2a3cb003
BLAKE2b-256 912dd75f04ee466e9f8dcc00c3c29628a9ec24f90e487c0e0575740d92147386

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.3.0-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 048dee0d1821f78f6036c1820a4994a0372aeb97b9fb9c7cb6cc7da670b75106
MD5 5fadb8a8c92980a279454ea424d41a93
BLAKE2b-256 f56b1d876fbd0751df5185f1ad0f99134f6a359d6e00650d89abad211f6c437c

See more details on using hashes here.

Provenance

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