Skip to main content

streaming-kql

Evaluate the stateless subset of the Kusto Query Language (KQL) over a stream of events — one record at a time. Pure Python, no external runtime.

Existing ways to run KQL need a cloud service, a local container, a .NET engine, or a JVM. streaming-kql runs the common, high-value part of KQL — filter, reshape, and enrich each event — entirely in-process in Python, with the same shape as an Azure Monitor DCR transformation or a Sentinel ASIM parser's per-row logic.

Status: alpha (M0). The engine currently supports where/filter, extend, project, project-away, project-rename, a scalar-expression grammar, and a starter scalar-function set. Stateful operators (summarize, join, sort, …) are rejected at compile time. See docs/SPEC.md for the full specification and roadmap.

Install

pip install streaming-kql          # (after first release)
# dev:
pip install -e ".[dev]"

Quickstart

import streaming_kql as kql

q = kql.compile("source | where Price > 80 | extend Note = strcat(Symbol, ' high')")

q.match({"Symbol": "MSFT", "Price": 90})
# {'Symbol': 'MSFT', 'Price': 90, 'Note': 'MSFT high'}

q.match({"Symbol": "MSFT", "Price": 10})
# None   (filtered out)

# stream any iterable of records; each input yields 0..N outputs
for out in q.stream(events):
    ...

Run many standing queries over one feed:

node = kql.Node()
node.add("high", "source | where Price > 80")
node.add("low",  "source | where Price < 10 | project Symbol, Price")
for query_name, record in node.push(event):
    ...

Register custom functions:

@kql.function("domain_of")
def domain_of(email: str) -> str:
    return email.split("@", 1)[-1]

kql.compile("source | extend d = domain_of(From)")

Documentation

Full developer documentation lives in docs/:

Supported KQL

The target is the full Azure Monitor transformations (DCR) KQL surface (single row in → ≤ one row out) plus all remaining stateless operators. See docs/supported-kql.md for the authoritative list, and docs/SPEC.md §5 with the implementation tracker in Appendix A.

Tests

Conformance tests are data-driven: add a tests/cases/**/*.yaml file with a query, input records, and expect records (or expect_error) — it is discovered automatically.

pytest

License

Apache-2.0. Design and initial evaluator are informed by Microsoft's Apache-2.0 Rx.KQL; see NOTICE.

Metadata

Release files for streaming-kql 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streaming-kql 0.0.1
File Size Uploaded
streaming_kql-0.0.1.tar.gz 85.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streaming-kql 0.0.1
File Interpreter ABI Platform
streaming_kql-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 129.1 kB

Release files / streaming_kql-0.0.1.tar.gz

Download URL streaming_kql-0.0.1.tar.gz
Size 85.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a0b673951f1c69a60dcfbb04541e3637d2c4c5fa0fc014f97d6223c0ff420954
BLAKE2b-256 checksum
How to use checksums
29030a3631d25e66b013a0f8b3c045f4b8301a635876aebd69bdeca823ff2464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / streaming_kql-0.0.1-py3-none-any.whl

Download URL streaming_kql-0.0.1-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dc814160289c810c727e4b1968f267e2a92544ad6220a32703a4be1f53765a3
BLAKE2b-256 checksum
How to use checksums
c6cedac14eeeff6891069ba35f646bf4be3760e3485b35629df636ec392e5d94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.2

2 release files

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page