export_data
Export OT historian samples from the local SQLite store into CSV, SQLite, or Parquet files, optionally filtered by time, endpoint, or tag, and receive the file path with a row preview.
Instructions
[READ][risk=low] Export collected samples from the LOCAL SQLite sink to a file.
Source is ~/.iaiops/data.db — the local queryable store written by
historian_push(sink="sqlite") — NOT a live device read. Writes csv (Excel),
sqlite (SQL browser / Power BI) or parquet (pandas/Spark; needs
pip install 'iaiops[export]'), and returns the file path + row count with a
bounded inline preview (first 200 rows max) so the response never floods.
Args:
fmt: 'csv' | 'sqlite' | 'parquet'.
since/until: Optional ISO-8601 time bounds (inclusive).
endpoint: Only samples from this endpoint label.
tag: Only samples for this tag.
limit: Max rows exported (1..100000; default 10000).
out_path: Output file; default ~/.iaiops/exports/iaiops-export-<ts>.<ext>.
Returns dict: {format, path, rows, preview_rows:[{ts, endpoint, protocol, tag,
value, quality, unit}] (≤200), preview_truncated}.
Example: export_data(fmt="csv", tag="line1.temp", since="2026-07-01T00:00:00").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fmt | Yes | ||
| tag | No | ||
| limit | No | ||
| since | No | ||
| until | No | ||
| endpoint | No | ||
| out_path | No |