pycsamt.iot.protocols.file#

File-backed telemetry transport (newline-delimited JSON).

A FileTelemetryClient appends each packet as one JSON object per line (JSONL) to endpoint. It doubles as a source: receive() walks previously written lines. This transport is dependency-free and is the natural default for offline logging, replay, and testing.

Classes

FileTelemetryClient([endpoint, dry_run, append])

Append/replay telemetry packets to a JSON-lines file.

class pycsamt.iot.protocols.file.FileTelemetryClient(endpoint=None, *, dry_run=False, append=True, **options)[source]#

Bases: BaseTelemetryClient

Append/replay telemetry packets to a JSON-lines file.

Parameters:
protocol: IoTProtocol = 'file'#
read_all()[source]#

Return every packet dictionary written to the file.

Return type:

list[dict[str, Any]]