Skip to main content

tdmspy

A pure Python reader for National Instruments TDMS files, MIT licensed. Its only runtime dependency is numpy.

It is written from the format specification and tested against real files and synthetic test cases, one for every special case of the format.

Install

uv venv --allow-existing
uv sync --all-extras

Usage

import tdmspy

file = tdmspy.read("measurement.tdms")  # indexes the file; no channel data is read yet
for group in file.groups:  # in file order, not sorted
    for channel in group.channels:
        print(group.name, channel.name, channel.dtype, len(channel), channel.properties)

values = file["rawdata"]["Channel1"].read()  # numpy array, native byte order, NI scaling applied
raw = file["rawdata"]["Channel1"].read(scaled=False)
part = file["rawdata"]["Channel1"].read(start=1000, stop=2000)

The details (what is returned for each data type, what is refused, how truncated files are treated) are in doc/design.md; every special case of the format the reader has to handle is listed with the files that exercise it in doc/special-cases.md.

Tests

just test        # lint, then everything except the slow tests
just test-all    # including large files and long fuzz runs
just testcases      # rewrite the stored synthetic files in tests/data/synthetic

The tests are the specification of the reader:

  • tests/catalogue.py lists every special case of the format. Add a case there first.
  • tests/builder.py is a byte-level TDMS writer for the tests (interleaved, big-endian, several chunks, truncated, corrupt, every property type, ...). It does not use tdmspy.
  • tests/testcases.py has one small file per special case, each with what it must read as (Truth). The files are stored in tests/data/synthetic; the long ones are built when a test needs them.
  • tests/data/real are real files, with their identifying strings replaced by placeholders; tests/test_real_files.py checks them and tests/test_privacy.py keeps identifiers out of the test data.
  • tests/test_reader_*.py are the tests of tdmspy.read: all test cases, the API, strict mode and scaling.
  • tests/test_fuzz.py and tests/test_robust.py damage files and read large ones.

just catalogue regenerates doc/special-cases.md.

Inspired by

npTDMS, pyTDMS and ICOschema, which tdmspy was created to aid: ICOschema reads TDMS files through it. No code of any of these projects is used here.

TDMS, LabVIEW and NI are trademarks of National Instruments. tdmspy is not affiliated with or endorsed by NI.

Licence

MIT, see LICENSE.

Metadata

Release files for tdmspy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tdmspy 0.1.0
File Size Uploaded Provenance Actions
tdmspy-0.1.0.tar.gz 267.5 kB With provenance Details for tdmspy-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tdmspy 0.1.0
File Interpreter ABI Platform Actions
tdmspy-0.1.0-py3-none-any.whl Python 3 none any Details for tdmspy-0.1.0-py3-none-any.whl

Total release size: 284.6 kB

Release files / tdmspy-0.1.0.tar.gz

Download URL tdmspy-0.1.0.tar.gz
Size 267.5 kB
Tags Source
SHA-256 checksum
How to use checksums
80dd7c3b25e446d47332d67e575f8659770fc7d3692c0715413b08bf38762fbb
BLAKE2b-256 checksum
How to use checksums
8405cc806e4aeeb40cf5110cd92d9716defe4ad52dfff4f74598ee4ab74a4823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

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 Nov 10, 2026.

Transparency log

Release files / tdmspy-0.1.0-py3-none-any.whl

Download URL tdmspy-0.1.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86a1f5e360c1cd8c4fc6c9e03212d6449c3b03a6d8f977ebb0bbb9d5b125d0ed
BLAKE2b-256 checksum
How to use checksums
f4fa34b63c54571e5ca9683bf7d4b500bb6f334a58d547dd27cf3962a6090f89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

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 Nov 10, 2026.

Transparency log

Security for tdmspy 0.1.0

Provenance

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tdmspy-0.1.0.tar.gz

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 Nov 10, 2026.

Transparency log

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

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page