drasi-lib

Embed the Drasi continuous-query engine in your Python application

Embed Drasi in your Python app

drasi-lib runs Drasi's continuous-query engine in-process in Python — no servers, no brokers, no Kubernetes. Define sources and reactions in plain Python, or load native Drasi plugins at runtime.

How drasi-lib Works

Install the package, create sources, continuous queries and reactions in code, and handle changes as they happen. Everything runs in-process — a native (PyO3) extension hosts the embeddable Drasi engine inside Python, with prebuilt abi3 wheels for Linux, macOS and Windows.

Install
pip install drasi-lib
Write Code
Create sources, queries and reactions
React to Change
Handle result diffs in your app

Push graph changes from your own code into a Python source, run a continuous query in Cypher or GQL, and receive the added, updated and removed rows in a Python reaction — without leaving your process. When you need to connect to real systems, load Drasi’s native source, reaction and bootstrap plugins at runtime, or pull them straight from the ghcr.io/drasi-project OCI registry.

When to Use drasi-lib

drasi-lib suits a Python application or service that needs precise change detection without deploying separate infrastructure:

  • Event-driven services — react to data changes without polling, with the before and after state of every change.
  • Real-time dashboards — stream live query results into a UI over your own channel, or load the dashboard reaction plugin and get one for free.
  • In-app reactive logic — replace hand-wired event handling with declarative continuous queries over your application state.
  • Data and ML pipelines — add reactive queries to an ETL step, a feature store, or a notebook, using the blocking API where async would be awkward.
  • Change data capture — follow a Postgres, MySQL, SQL Server or Kafka source through a plugin, and query across several of them at once.

Documentation

Everything you need to build with drasi-lib, from a first continuous query to the full API surface.