Skip to content

Python API

The stable API (from ntpstats import api as nt) lists the names covered by the deprecation policy, in one namespace. The module pages below document everything, including the provisional parts.

from ntpstats import load, load_one
from ntpstats.stability import series_stability
from ntpstats.analysis import summary, compare

s = load_one("/var/log/chrony/measurements.log", peer="192.0.2.10")
print(summary(s)["range_90"])
for r in series_stability(s, kinds=("oadev", "tdev"), ci=0.95):
    print(r.kind, r.taus, r.dev, r.lo, r.hi, r.alpha)

A TimeSeries has t (POSIX seconds), offset (seconds, reference − local), extra (per-sample columns such as delay) and meta.

Module Contents
ntpstats.series TimeSeries
ntpstats.parsers load, load_one, per-format parsers
ntpstats.stability estimators, confidence intervals, noise ID, dynamic
ntpstats.edf equivalent degrees of freedom
ntpstats.analysis summary, detrending, outliers, compare
ntpstats.network delay floor, wedge, FPP, min-delay filter
ntpstats.filters Kalman filter and RTS smoother
ntpstats.estimators estimator API and reference algorithms
ntpstats.simulate clocks, paths, scenarios with ground truth
ntpstats.bench benchmark runner
ntpstats.trace, ntpstats.ptpsim delay traces and replay; PTP servos and boundary-clock chains
ntpstats.sntp, ntpstats.nts measurement clients (NTPv4, RFC 9769 interleaved, NTPv5, NTS, NTS pools)
ntpstats.roughtime Roughtime client, chained measurements, malfeasance reports
ntpstats.spectrum, ntpstats.noisefit PSDs, L(f); power-law noise fit h_α
ntpstats.hat, ntpstats.holdover N-cornered hat / Groslambert covariance; holdover prediction
ntpstats.research CGGTTS, RINEX clock, Circular T, RIPE Atlas, NTP Pool, the interop dataset
ntpstats.otlp OpenTelemetry (OTLP/HTTP JSON) export
ntpstats.plugins plugin entry points and discovery
ntpstats.adapters pandas, xarray, Parquet/Arrow
ntpstats.api, ntpstats.stream, ntpstats.deprecation stable surface, large files, deprecation helpers
ntpstats.masks, ntpstats.report masks, HTML reports