Skip to main content

Community object-oriented Python 3 bindings for the National Instruments TestStand™ COM API

Project description

py-teststand

PyPI version Python versions License: MIT Downloads

Community object-oriented Python 3 bindings (twin API) for the National Instruments TestStand™ COM API.

⚠️ Early Implementation Stage: Treat it as experimental. Wrapper behaviour may change between releases without notice (like error catching). 🤖 AI Disclaimer: This project uses LLMs for codebase and coverage audits and does not replace or integrate with the NIGEL™ AI Advisor.

📖 Overview

py-teststand exposes the TestStand™ COM API as an object-oriented Python interface via pywin32.

📛 Name

The package is named py-teststand (with a dash) to avoid naming collision with the pytest testing framework and for easier relation to TestStand™ test executive.


🚧 Project Status

py-teststand is a hobby project, maintained on a best-effort basis and not yet under active full-time development ahead of the first release. There is no fixed release schedule or formal support, but feel free to get in touch.

That said:

  • 🐛 Bug reports and feature requests are welcome via GitHub Issues.
  • 🤝 Pull requests are welcomed and reviewed. If you are working with the TestStand™ COM API and have improvements, fixes, or additional bindings, contributions are encouraged.

If you hit a missing TestStand™ binding, a wrong type annotation, or unexpected TestStand™ COM dispatch behavior, open an issue with a reproducible case. That is the best way to get it fixed, and I will investigate and try to find a solution as fast as I can.


🛠️ Implementation Notes

⚙️ Type Library Generation

Python class stubs and interface definitions are generated from the TestStand™ COM Type Library (.tlb) using pywin32's makepy utility. The generated output is cached as a pywin32 dispatch cache module and checked into the repository, meaning a live TestStand™ installation is not required at import time, only at runtime when TestStand™ COM objects are actually instantiated.

The generation process follows this pipeline:

  1. 🔍 TLB introspection: makepy reads the registered TestStand™ COM type library via the Windows registry and reflects all exposed interfaces, CoClass definitions, enumerations, and dispatch IDs.
  2. 💾 Cache dump: The reflected TestStand™ metadata is serialized into a Python module stored under win32com/gen_py/, keyed by the TestStand™ type library GUID and version. This cache is committed to the repository so users do not need to run makepy themselves.
  3. 🧩 Wrapper generation: py-teststand classes are authored on top of the cached TestStand™ dispatch definitions, adding Python type annotations and translating raw COM VARIANT and IDispatch returns into typed Python objects where applicable.

This approach means the bindings target a specific version of the TestStand™ type library. The bindings stay compatible across TestStand™ engine versions by tracking the stable, long-lived COM interfaces that exist across the supported range.


🎯 Design Goals

  • 🐍 Python 3.8 minimum: Python 3.8 (uv supports and distributes even 3.8.20) is the last CPython release with official Windows 7 support. Many manufacturing and test environments run long-lifecycle OS images on air-gapped station hardware where upgrading the OS is not feasible on short timescales. A 3.8-compatible codebase lets you adopt Python-based automation incrementally on existing TestStand™ station hardware without migrating the platform first.
  • ⚙️ TestStand™ station options as code: The TestStand™ Station Options object model is fully exposed, so TestStand™ search directories, model paths, station globals, and result processing configuration can be read and written programmatically. This makes station configuration reproducible and suitable for provisioners such as Ansible, Chef, or custom deployment scripts. It replaces manual point-and-click setup with version-controlled configuration.
  • 📄 No TestStand™ documentation mirroring: The library does not duplicate or paraphrase the official TestStand™ API reference in its docstrings. Reproducing NI's documentation would create a secondary source that drifts from the official TestStand™ spec as new versions ship, which risks spreading misinformation. For authoritative descriptions of TestStand™ COM objects, properties, method parameters, and return value semantics, refer directly to the TestStand™ API Reference.

🧰 Technical Stack

Tool Purpose
uv Python package and project manager
ty Static type checker for interface validation
ruff Linter and code formatter
pytest Unit and integration test runner
pywin32 Windows COM dispatch layer and TestStand™ TLB introspection

🔗 Compatibility

Component Versions
Windows 7 to 11
Python 3.8 to 3.14
TestStand™ 2016 to 2026+

ℹ️ Older TestStand™ engine versions may also work if the underlying TestStand™ COM interfaces have not changed, but they were not explicitly tested.


✨ Features

  • 🐍 Pythonic attribute access: TestStand™ COM properties are accessible via standard Python attribute notation instead of raw Dispatch calls.
  • 🏷️ Type annotations: All public members carry type hints compatible with ty.
  • ⚙️ TestStand™ station options provisioning: Read and write TestStand™ station-level configuration suitable for use in automated deployment pipelines (like test-station install scripts).
  • 🪶 Minimal binding surface: No behavior is added beyond what the TestStand™ COM layer provides. Edge cases and error conditions follow the TestStand™ COM API contract documented in the official TestStand™ reference. The binding layer is intentionally lightweight and not overcommented. Signatures and the object hierarchy map directly to the TestStand™ COM API without adding abstraction or reinterpreting behavior (modules are grouped by domain for easier navigation).
  • No live TestStand™ installation required at import time: The committed pywin32 dispatch cache allows the library to be imported and partially used (type checking, configuration building) without a TestStand™ installation present.

🚀 Installation

⚡ uv

uv add py-teststand

📦 pip

pip install py-teststand

📈 Popularity Over Time

Star History Chart


⚖️ Legal

TestStand™ is a registered trademark of National Instruments Corporation. Refer to NI's TestStand™ licensing options for information on required licenses to operate the TestStand™ engine.

py-teststand is an independent community project and is not affiliated with, endorsed by, or maintained by National Instruments or its parent company Emerson. References to the TestStand™ API are made solely for interoperability purposes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_teststand-0.2.1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_teststand-0.2.1-py3-none-any.whl (190.7 kB view details)

Uploaded Python 3

File details

Details for the file py_teststand-0.2.1.tar.gz.

File metadata

  • Download URL: py_teststand-0.2.1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for py_teststand-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9904a34905f8a1dc1ea99b1589e2629841fdc8fe7258e7b31f0525f0575b4213
MD5 da1dafb909255c4faabf29ba299f3feb
BLAKE2b-256 9eb0f9191b498a4a180d2452e0d8bed97bfaa614f71131d44e200e3569180d46

See more details on using hashes here.

File details

Details for the file py_teststand-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: py_teststand-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 190.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for py_teststand-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eede699cb2916326f7110f42071de476a7b30b6533aee513cd30f0c03ed5bff9
MD5 e9b2a31572dcda3d22b2dee5f3a5547f
BLAKE2b-256 e82c3a0b9d062ebdcbad7aad5d81cecad1dea41f457b7919a3b1949006ab31c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page