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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14

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

Uploaded CPython 3.14

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

Uploaded CPython 3.14macOS 11.0+ ARM64

rtbot_sql-0.2.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.2.0-cp313-cp313-win_amd64.whl (982.8 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13

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

Uploaded CPython 3.13

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

Uploaded CPython 3.13macOS 11.0+ ARM64

rtbot_sql-0.2.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.2.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rtbot_sql-0.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 983.2 kB
  • 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.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 58b5144663444ad04202428264dd551dbb0d40d16942a1f0352875ed55c1686f
MD5 d9593e26583900556e4e781779d3bac2
BLAKE2b-256 c887db4245ccef08b466aee010f264d7f833ccf4ee76a9e180f799863c7c6119

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86f50df4ff3fb262cd3c0904b9323e9cf669e5bdaf35075775e73965a9ee00f2
MD5 e0b16d1fc1f4f97191f0bc1da251ea10
BLAKE2b-256 44c19be2d5ff5287dcc0fe373dce9bcaaedb9ce7cf0aa8ed1bdc492d723164c9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 feb9cb3df8e95656fc078769aa6e7b6594446fc1204cbb87f48a03c560dced72
MD5 47bf88d493167cfcd257807abb0361b1
BLAKE2b-256 0cb3507c35c5c95b0f8fc4ff17a0c7adfb24d9c817a95e528299a701c674ec69

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87060316481c9b99b3d635ec3e3b0b522d96b97fb929cbe1207ef7dceb53260a
MD5 9251760a9784ceabded328e184f1b241
BLAKE2b-256 f44e7cd1b33b0644c98494bb6882667ecb75476108bbb50d4ec58ace5dfa823e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp314-cp314-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 793310eed13b9f1718df0548f0b5d4963fb538951b14ff23c04e3498e7588054
MD5 83e3803b48220bac91ecd46970835ba0
BLAKE2b-256 8fad85225f364ec0273c836e8efbbae8b4daeace94e94c80a3f81f3135f1d731

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rtbot_sql-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 982.8 kB
  • 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.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0878fe305f822ef69765971a82d5b2fb17baaa5c516f0d039cf5110bc5cdcc34
MD5 633ccbbe26a1d6c801f8ff6064e87cf0
BLAKE2b-256 32f2cbad1bebc4d08c71fb1cc862de69d426aff723be30f0100b2eae77f88baf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c04adf815e9f412bdea72829d6dbea764f89a36f103d0536eac98c47c5a75d3b
MD5 2a703741b41b29c40732154822cba18c
BLAKE2b-256 17c35c29d9bcf96d443d5708a94ab18b26e901991890095eca3baf098904d9d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bfa3c99ec152b387ee320b0bfbcd0a390639e0bbdeb4afba57584bc0177e5ab9
MD5 c22df0a1319a7fa23737a48d7997bcdc
BLAKE2b-256 e73750e17a8532de01fc14dc0af9b959e9619fe084c582d4f386f0998123d16f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a12f0ca8409f109d92461783d9aec1864d157fc794dbbba65dd9760308038fd3
MD5 9081aa2837453ea6a914f8b478d229f7
BLAKE2b-256 ae5e0edc96facf8b9e730de4a94880e8bc08e71b2349ca08efe37585947fa77a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.2.0-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f41c964e73dd85179768e1c5c60f207df41514b8a84dbb3d2a2581527ac14fff
MD5 83882f6f65714a472f5841cfe10a33cd
BLAKE2b-256 d22a123d0c571284f3bd8a7679d688cbea14ea7c32d38c1a7daf12dff2c25de9

See more details on using hashes here.

Provenance

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