drasi-lib
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.
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
dashboardreaction 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
asyncwould 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.
Getting Started
Install the package and run your first continuous query in a couple of minutes.
Concepts
The change-driven model: sources, continuous queries, reactions and bootstrap.
API Reference
Every method on the Drasi class, grouped by area, with types.
Postgres Dashboard
An end-to-end example following a Postgres table into a live dashboard.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.