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.simio OMNeT++/INET and ns-3 exchange formats
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
ntpstats.pcap, ntpstats.ptp NTP, NTP over PTP and CSPTP exchanges from pcap/pcapng captures; PTP flows
ntpstats.timeerror max|TE|, cTE, dTE, TEL, limits and masks
ntpstats.ubx, ntpstats.gnsslab u-blox UBX, gpsd PPS, TAPR TICC, PPS sawtooth correction
ntpstats.sources, ntpstats.profiles live samples from the local daemon (chrony, ntpd, ntpd-rs, ptp4l, ptpcheck, gpsd); instrument profiles and column mapping
ntpstats.bounds validation of clock-error bounds (ClockBound, fbclock)
ntpstats.hwclocks PHC against the system clock, OCP Time Card, ClockBound and fbclock windows, ptp4l port states
ntpstats.fleet many hosts ranked against the same limits; matching Prometheus alert rules
ntpstats.audit, ntpstats.events UTC traceability audit; steps, spikes, route changes, leap smears
ntpstats.disciplines clock disciplines in closed loop: ntpd (reference or RFC 5905 constants), LOCKCLOCK, Levine's Kalman
ntpstats.polladvice poll-interval advice: the longest interval that meets an accuracy target
ntpstats.refcheck validation against an independent reference (ntpstats validate), synthetic campaigns
ntpstats.testing pytest assertions for timing checks in CI
ntpstats.interop data exchange with Stable32, TimeLab and other stability tools
ntpstats.metrics Prometheus/OpenMetrics exporter
ntpstats.compat.allantools allantools-compatible functions