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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14

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

Uploaded CPython 3.14

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

Uploaded CPython 3.14macOS 11.0+ ARM64

rtbot_sql-0.1.16-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.16-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13

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

Uploaded CPython 3.13

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

Uploaded CPython 3.13macOS 11.0+ ARM64

rtbot_sql-0.1.16-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.16-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rtbot_sql-0.1.16-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.16-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1900c9090f72e3811cd7c2023b55e19a282c98ff7261c58e68e47cc4b42048d7
MD5 7f411f2e59a986fa690ab20763a452c1
BLAKE2b-256 afe30f3af4691d9200836447cc6f1984f24410baf40441e9fe7349018436d1c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cfd1f043893604ab87e211ab46febfbd6774822d404c75bdf41bcf440fdbcebc
MD5 01e2c14fe3f9412d0a4d17280015716a
BLAKE2b-256 1a7d373442d2c6448d0efaef1dd4e619eedb54a99be3dc412799ac6d2244f5c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 622142dd657e47cee6ed2ecaa0d18135ff05be8a2a39fee73b773c6e48333b67
MD5 de766b9e5672f5e28c41fb6368af36c8
BLAKE2b-256 eba2a724e10556f13512f5319efde2e07963e861d58f11d8b28dbacd7d8a5d7f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e5b01a31d9b4480415280ba9cdcbb4bbc01a2eecc632ab187297e029b7674158
MD5 d4b3f2aae1dbfa94f25e205792f96992
BLAKE2b-256 05b649db01de8ac1163eee8df8d3aba31b7ce7cfef2a9a8632b3a2eeec5df7f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp314-cp314-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 896054aa6ab15e2f3c01aee4900fb717f12cc68ef0327ab4d38383d200a717bf
MD5 024fe925dce8882edbe1275f66f9c98f
BLAKE2b-256 9d54d689ab50634892c38a618788cac99e77b7f94f202bdf9a8e556b62d66fc6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rtbot_sql-0.1.16-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.16-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 827318c81b5d18e1718966cf4c215dfb076a686c5a363c04e5fec98b07c150a9
MD5 599759a6d2064047d18e7683d3bb10ce
BLAKE2b-256 35e2603d6000998337718643fd86c165da692a269e9d33972f5118d187789dd2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05a4708ca0b8a745f989af001d944e3e8621b2f6ea3647ddebee64d0ea3ad4d5
MD5 28b7abd17b226c5503edb5edac3288d0
BLAKE2b-256 6c4ca081d942dc2b201e81f150be1ffdcc44c9fe3a4f5a19408a6d79facff9df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 49860b1f7125770ef35cac194c05c47faab461952ed5c7543b0ed1e66da3115a
MD5 9635703bc95125c32a8a1c6dd2de7263
BLAKE2b-256 13f4a38c4b34c6f8e07a2ee01cfcb9f549fefd033c450a387edfaec5494ab07e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2dd0f6092d4d3d2b68210c09bcac855629108b91a0b385e004e89666f293bc0
MD5 c9bfba0cec5ab93c94320fda3239d983
BLAKE2b-256 eaaf96896e09004d39740c43264699669f59e10556af923b6d8cf06c4157c1a4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rtbot_sql-0.1.16-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 41d324ea5fb733187f1dd612e3ba00db2dd2dd3662b95fbb5aba8c4839b72c37
MD5 1c9865708ae75c6d7afd298c6f24722f
BLAKE2b-256 a9eb1ff70dd6ed06a138d7f5682c512028732fdd37b7a26c304faeec221a0ec0

See more details on using hashes here.

Provenance

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