Oninit® UDR — TimeSeries API: Python client
A thin client wrapping the SQL
read call for application code, so callers don't build the
oni_ts_read() invocation or parse its JSON response by
hand.
Usage
from oni_tsapi.factory import create_backend
from oni_tsapi.client import TimeSeriesClient
from oni_tsapi.series import InformixSeriesRef
from datetime import datetime
backend = create_backend({
"version": 1,
"backend": "informix",
"informix": {"dsn": "..."},
})
ts = TimeSeriesClient(backend)
result = ts.read(
key=InformixSeriesRef(427),
start=datetime(2026, 9, 1),
end=datetime(2026, 10, 1),
metrics=["cpu.usage", "cpu.system", "cpu.wait"],
)
The key is an opaque SeriesRef
(InformixSeriesRef), not a bare int —
callers construct one explicitly rather than passing a raw primary key
through several layers.
Configuration
create_backend() takes a plain dict, not a file path —
loading it from YAML, environment variables, or anywhere else is the
caller's own job, kept deliberately separate from backend selection
itself.