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

Uploaded CPython 3.14Windows x86-64

rtbot_sql-0.1.17-cp314-cp314-manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.14

rtbot_sql-0.1.17-cp314-cp314-manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.14

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

Uploaded CPython 3.14macOS 11.0+ ARM64

rtbot_sql-0.1.17-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.17-cp313-cp313-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.13Windows x86-64

rtbot_sql-0.1.17-cp313-cp313-manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13

rtbot_sql-0.1.17-cp313-cp313-manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.13

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

Uploaded CPython 3.13macOS 11.0+ ARM64

rtbot_sql-0.1.17-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.17-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rtbot_sql-0.1.17-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.5 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.17-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 40df81b073c645253b788191b7dd0bb07ac6139095220b2799dfa4bce995e8a2
MD5 4363baaf33d78f7122376076dd03c8d4
BLAKE2b-256 e95c30bf9137d7a0b3945f4293719a50939abbea377700cf4e6bc68c41610ce8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 076bf672ffab1b2dedc354f69a6fab1d893a9b80f6a971c51ff57f2b7329979e
MD5 51e66977fba2eca83dbdd515d0d95452
BLAKE2b-256 c8246d17e5aa8a3c930d7d4bacd73873f1273361e5110659fa0d48df8b322e89

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 28833a8c7a2e478d6b4693c9ebf07400307bf6b3f2843bb9243be5bfda3bba87
MD5 08577b33d38108f5f0c6fe92588480b9
BLAKE2b-256 e73f94eb42f9ed76044ae5a266777cb3f97bb52153d5647240efbac3384251d4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6163b0be316a511fc99d880a7f8f4c50f4adc12772e14c380eb9b536de2eec2
MD5 fad563bcdf376c99a15eb5d128de72f5
BLAKE2b-256 5c11ac62a961273a427903b8572cdb629d8bf0169f393f91fdd04f62c7e96581

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp314-cp314-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2029eca60982b7f50941f5bcf97b0e76cf84b12a1ceb2a44ebc0cf9e2432e3e7
MD5 25e1ca9a0975ffbbed53b8045442420f
BLAKE2b-256 1924f5749d3785695e17ca320d0d9c47c0a54059bd63085fcabe078cbca3d813

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rtbot_sql-0.1.17-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.5 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.17-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 888ca668a1a0b22e954796934e24783050d7138c1ddcea86e589985202c9dc8a
MD5 493b1f4768c5bbe5137e809d7d23e7f6
BLAKE2b-256 827aa66630cb7daff50eddb9c2cb6e76cb6c46413006a49a78ac3b7c8c4acd9d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38c4ca52add2afde6a07d9d43567684cd46ddee3e82c5afa754ea64e7b14f585
MD5 2e416a6326639480145d34f2fb076b35
BLAKE2b-256 d1cf90a05b5050169cbdb4489ad5142e6be739904e2df931d25f1d2da4d9c082

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ee2bae48b5efc6d61930c93e9b8edf9137328071a1b8dd68eebca5e86135cc44
MD5 5e0fbf56a9c9cd01cfcbf79be3f4fd51
BLAKE2b-256 075d6b3739e2c98ffe3330827f97ec020faae665966c3bea0bf16058923b2983

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06f9e62da871d01fe6e69a694fa6f7451ec19d8eccac03d78e012f68eba82af9
MD5 bc5116c8e73f799592df10a296935ca8
BLAKE2b-256 7fb1dd9a763066bd70eaef19b248013102de64100a53273fe9a979563e03fb04

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.17-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 88962e725b9ea8151121343c08cd2120265ee751b7fab93e3c88e3c3c233eec1
MD5 a5167141b65720cba4921536a7f4d010
BLAKE2b-256 0a4804340119b03accb9c6e6127d84a31e632f0568c992f0b1ad4a3998d22905

See more details on using hashes here.

Provenance

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