"""Read a metric stream back with the low-level client. Pass a stream id (copy it from the run page or the API) and the example prints one bounded page — up to ``limit`` stored points. The same LAUNCHHELM_* environment applies. python query_points.py """ import os import sys import launchhelm stream_id = ( sys.argv[1] if len(sys.argv) > 1 else os.environ.get("LAUNCHHELM_STREAM", "") ) if not stream_id: sys.exit("usage: python query_points.py ") client = launchhelm.Client( os.environ["LAUNCHHELM_URL"], os.environ["LAUNCHHELM_API_KEY"], os.environ["LAUNCHHELM_ORGANIZATION"], ) result = client.query( stream_id, start="1970-01-01T00:00:00Z", end="2261-01-01T00:00:00Z", limit=1000, ) for point in result.get("items", []): print(point.get("observed_at"), point.get("value"))