Python port of OpenPlait — a datasource-independent query and dataframe layer for analytics and observability applications.
Status: alpha. The TypeScript @openplait/* packages under
../typescript are the reference implementation. This package
mirrors core, adapter_sdk, and runtime first; backend adapters land
incrementally.
pip install openplait
# or from this repo:
poetry installRequires Python 3.9+.
from openplait import OPENPLAIT_API_VERSION
from openplait.core import parse_query, validate_query
from openplait.runtime import DatasourceRegistry, OpenPlaitRuntime
document = {
"apiVersion": OPENPLAIT_API_VERSION,
"kind": "Query",
"metadata": {"name": "spans-sample"},
"spec": {
"mode": "semantic",
"datasource": {"kind": "ClickHouseDatasource", "name": "primary"},
"input": {"signal": "traces", "entity": "otel.spans"},
"select": [{"field": "service.name"}],
"limit": 25,
},
}
query = parse_query(document)
assert validate_query(query).valid
registry = DatasourceRegistry()
runtime = OpenPlaitRuntime(registry)
# Register adapters with secrets from your vault / env — never from the query IR.| Module | Role |
|---|---|
openplait.core |
openplait.io/v1alpha1 models, parse/validate |
openplait.adapter_sdk |
Adapter protocols and errors |
openplait.runtime |
Datasource registry + runtime orchestration |
openplait.adapters |
Backend adapters (ClickHouse scaffold first) |
Push a py-*.*.* tag that matches [tool.poetry].version to publish.
See ../PUBLISHING.md.
Apache-2.0