Skip to main content

lvtypedesc

Parse LabVIEW type descriptors into a typed tree, render them, and write them back.

A LabVIEW type descriptor is the short, length-prefixed block of words that says what a piece of flattened data is: an I32, a 2D array of Booleans, a cluster of named fields. LabVIEW's Variant To Flattened String returns one as its "type string", and you need it parsed before you can decode the data that goes with it. lvtypedesc reads that block into frozen dataclasses you can inspect, prints it as one line or as a tree, and writes a tree back to the exact bytes. Pure Python, no dependencies, fully typed.

Install

pip install lvtypedesc

Quick start

>>> from lvtypedesc import describe, parse_type_descriptor, pretty, to_bytes
>>> data = bytes.fromhex(
...     "002A 4040 0001 FFFFFFFF 001A 0050 0002 0006 4003 016E"
...     " 000E 4030 FFFFFFFF 046E 616D 6500 0472 6F77 7300"
... )
>>> node = parse_type_descriptor(data)
>>> describe(node)
'1D Array of Cluster { I32, String }'
>>> print(pretty(node))
Array (rank 1, dims [variable]) 'rows'
  Cluster (2 fields)
    [0] I32 'n'
    [1] String (size variable) 'name'
>>> node.element.fields[1].label
'name'
>>> to_bytes(node) == data
True

The tree is made of Scalar, Boolean, LVString, Array, Cluster, LVEnum, PhysicalQuantity, LVVariant, FixedPoint, Refnum and Waveform nodes. Element and control names travel in label. The command line does the same from a shell:

$ lvtypedesc decode 000E00400001FFFFFFFF0004000A
1D Array of DBL

The guide covers every node, the command line, errors and limits; the changelog lists what changed in 1.0.0.

What it reads, and how it was checked

The format is the one NI documents on its Type Descriptors page for Variant To Flattened String: a 16-bit length, a 16-bit type-code word whose low byte is the type, type-specific fields, and an optional name. Supported: every numeric type, enums, numbers with units, Booleans, strings, paths, pictures, arrays and clusters nested to 64 levels, variants, and element names. Fixed-point numbers, refnums and waveform types (time stamps among them) are recognised and their bytes kept verbatim, because their layout is version-specific. Typedefs, sets, maps and void are refused with a named error.

The parser is tested against what LabVIEW 2026 itself wrote and read on a real machine: the descriptors in front-panel datalog files of sixteen shipped VIs (error clusters, paths, enums, refnums, time stamps, fixed-point numbers, 1D and 2D arrays, variants), whose single-type entries it reads and writes back byte for byte (arrays and clusters are rebuilt in the nested form for the tests), and the answers of LabVIEW's own type-descriptor VIs (vi.lib/Utility/GetType.llb) on arrays, clusters, enums, units, strings and refnums, and the nested descriptors those VIs build.

LabVIEW also stores types as a flat list where arrays and clusters point at their elements by index (datalog files, flattened variants with attributes, VI files). This library reads the nested form; NI's page describes both.

Why

The LabVIEW packages on PyPI work on LabVIEW source files: pylabview and pylavi describe themselves as LabVIEW file parsers and lvkit converts VIs to Python (as listed on PyPI on 2026-10-15). None offers a small reader and writer for the type string itself. OpenG's LabVIEW Data Tools parse it inside LabVIEW, as VIs. lvtypedesc is that reader for Python: one function in, one function out, a tree you can type-check against.

License

MIT. See LICENSE.

Metadata

Release files for lvtypedesc 1.0.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 lvtypedesc 1.0.0
File Size Uploaded Provenance Actions
lvtypedesc-1.0.0.tar.gz 51.6 kB Without provenance Details for lvtypedesc-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 76.0 kB

Release files / lvtypedesc-1.0.0.tar.gz

Download URL lvtypedesc-1.0.0.tar.gz
Size 51.6 kB
Tags Source
SHA-256 checksum
How to use checksums
75ab22263f37b993247a5c61a8a6741d4c1d4f287743207de23eea982b813b09
BLAKE2b-256 checksum
How to use checksums
904d12cbc79af8102d032f6618f4b5c196b60fe3937a0a44e3fbe251a229889f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / lvtypedesc-1.0.0-py3-none-any.whl

Download URL lvtypedesc-1.0.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b2ad26b1137dc35509a8975829b77c23cd3148bda9a368d106e224c6a00a37a
BLAKE2b-256 checksum
How to use checksums
6bf1ce2585ed3bb8b795ecc5a673fde058ba97b5c324b56b22eb2e88068496ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for lvtypedesc 1.0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

1.0.0 This release

2 release files No 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