Skip to main content Switch to mobile version tdmslens 0.1.0 Inspect NI TDMS measurement files (LabVIEW, DAQmx) from the command line or any AI agent over MCP
pip install tdmslens==0.1.0 Copy PIP instructions
Inspect NI TDMS measurement files from the command line or from an AI agent over MCP. TDMS is the format LabVIEW, NI-DAQmx, VeriStand and FlexLogger write test and DAQ data in. tdmslens reads it without NI software and returns compact JSON: the file's layout, exact statistics over every sample, and bounded slices of a channel. It can also write channels to CSV.
A language model cannot read a 50 MB recording, and given a preview it will guess. tdmslens streams the whole file and reports where things happen. For example, a strain channel with a sensor stuck for half a second:
$ tdmslens stats run42.tdms --group Rig --channel Strain --low -0.01 --high 0.01 { "channel": "Strain", "count": 2000000, "nan": 0, "max": 0.25, "max_at": {"index": 1500000, "time_s": 150.0, "time": "2026-06-01T03:32:30.000000Z"}, "mean": 0.000626, "std": 0.012524, "rms": 0.012540, "longest_constant_run": {"value": 0.25, "start": 1500000, "length": 5000, "time_s": 150.0}, "range_check": {"above": 5000, "excursions": 1, "excursions_listed": [{"start": 1500000, "length": 5000, "peak": 0.25, "time_s": 150.0}]} } (Output shortened and rounded.)
Sample indices count from 0 within a channel. For waveform channels (wf_increment) every index comes with time_s from the waveform start, and with an absolute UTC time when the file stores wf_start_time. LabVIEW stores 1904-01-01 for relative-time waveforms; that is treated as "no absolute time".
pip install tdmslens # CLI and Python API pip install "tdmslens[mcp]" # plus the MCP server Python 3.10 or newer. Dependencies: npTDMS (LGPL-3.0) and numpy. No NI software is needed.
Claude Code, Cursor and other MCP clients
claude mcp add tdmslens -- uvx --from "tdmslens[mcp]" tdmslens-mcp Or in a client's JSON configuration:
{"mcpServers": {"tdmslens": {"command": "uvx", "args": ["--from", "tdmslens[mcp]", "tdmslens-mcp"]}}} The three reading tools are marked read-only; tdms_export is marked as writing.
The hermes/ folder is a Hermes plugin with the same four tools. It applies Hermes' read denylist to every file it reads and Hermes' write denylist to every export.
import tdmslens tdmslens.info("run42.tdms") tdmslens.stats("run42.tdms", group="Rig", low=-0.01, high=0.01) tdmslens.read("run42.tdms", "Rig", "Pressure", max_points=1000) tdmslens.export_csv("run42.tdms", "run42.csv", "Rig", step=10) What it handles
Files from LabVIEW, the NI TDMS C library and DAQmx logging, TDMS 1.0 and 2.0, little and big endian, many segments, interleaved and defragmented data, and .tdms_index files.
DAQmx raw data with NI scaling (NI_Scale[n]_*): values come out scaled, and the channel is marked daqmx_scaled.
Recordings cut off by a crash or power loss: the samples present are read and the file is marked incomplete_final_segment. NI's own TDMS library refuses such a file.
All TDMS data types: integers up to 64 bits, single and double floats, complex, booleans, strings and timestamps. Complex channels are counted but not summarised.
Every result is size-capped: 100 channels per info page (up to 500), 60 properties per object, 300 characters per string, 5000 points per read, 20 listed gaps or excursions per channel, 200 channels per stats call. tdms_stats stops after 120 seconds and says which channel and index it reached; tdms_export stops at max_rows (default 1,000,000) or after 600 seconds and says so. An export is written to a temporary file in the destination folder and moved into place when complete; it never replaces a file unless overwrite is true, and never the TDMS file it reads. NaN and infinite values appear as null in JSON (counted under nan and inf). In a reduced tdms_read, a bucket containing NaN keeps a null at its first NaN, so dropouts stay visible. Empty-string properties are left out of tdms_info, and one tdms_info result returns at most about 200,000 characters of property text; past that, properties are counted, not shown. Exported files are created with the user's normal file permissions.
Unit tests compare every statistic with numpy over random data, read in blocks as small as one sample, so every chunk-boundary case is exercised.
npTDMS's real example recordings: DAQmx raw data with scaling, DAQmx digital lines, big-endian, raw timestamps.
bench/ni/ writes a 56 MB corpus with NI's own TDMS library (four 2-million-sample channels with a spike, a NaN dropout and a stuck value, a timestamp channel with gaps, a defragmented copy and a crash-truncated copy) and checks tdmslens against NI's reader: every count, extreme, position, mean, standard deviation, range count and exported value matches.
The MCP server is tested over stdio with the MCP client SDK, and the Hermes plugin passes hermes plugins validate.
MIT. npTDMS, which tdmslens depends on, is LGPL-3.0.
Released: Dec 5, 2026
Author: rodricksz4h5
Both files in this release have provenance metadata.
View provenance details
MIT View SPDX License List
tdms labview national instruments ni daqmx measurement mcp test and measurement
Intended Audience Science/Research
Operating System OS Independent
Programming Language Python :: 3
Topic Scientific/Engineering
Release files for tdmslens 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 58.1 kB
Release files / tdmslens-0.1.0.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Release files / tdmslens-0.1.0-py3-none-any.whl
Security for tdmslens 0.1.0
Both files in this release have been uploaded with provenance metadata.
With provenance tdmslens-0.1.0.tar.gz Dec 5, 2026
With provenance tdmslens-0.1.0-py3-none-any.whl Dec 5, 2026
Attestation for tdmslens-0.1.0.tar.gz
Attestation for tdmslens-0.1.0-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 5, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 4d99e05











