Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

nitlsconfig

Python API that reads nitlsconfig configurations through the nitlsconfig command line, and builds gRPC client channels from them.

Installed and imported as nitlsconfig; developed at ni/nitlsconfig-python.

Runtime dependencies

  • nitlsconfig executable, discoverable.

Install

Reading NI-TLS configuration is pure Python and has no third-party dependencies:

  • pip install nitlsconfig

The gRPC channel factory additionally needs grpcio, which is an optional extra:

  • pip install nitlsconfig[grpc]

Creating a gRPC channel

create_grpc_device_channel reads the local NI-TLS client configuration for the NI gRPC Device Server and returns a grpc.Channel secured accordingly. The server_address hostname or address is used to select matching target-specific NI-TLS settings. Pass the channel straight to any NI gRPC Python API:

import nidcpower
import nitlsconfig

with nitlsconfig.create_grpc_device_channel("localhost", 31763) as channel:
    options = nidcpower.GrpcSessionOptions(channel, "")
    with nidcpower.Session("Dev1", grpc_options=options) as session:
        ...

The channel is mutually authenticated, one-way TLS, or insecure depending on how the machine is configured; no code change is needed to move between them. The channel is owned by the caller - NI driver APIs never close it.

Retries are opt-in:

channel = nitlsconfig.create_grpc_device_channel(
    "localhost", 31763, retry_policy=nitlsconfig.RetryPolicy()
)

TlsConfigurationError is raised when TLS is enabled but the configuration is unusable. It is always importable, since handling it does not require grpcio.

create_grpc_device_channel and RetryPolicy do require grpcio; accessing them without the grpc extra installed raises ImportError telling you which extra to install.

Reading configurations

import nitlsconfig

# List configured services
clients = nitlsconfig.ClientConfig.list_services()
servers = nitlsconfig.ServerConfig.list_services()

if clients:
    # Read one client configuration
    client_info = nitlsconfig.ClientConfig(clients[0])
    print(client_info.service_name)
    print(client_info.certificate_mode)
    print(client_info.certificate_chain_location.scheme)
    print(client_info.certificate_chain_location.path)
    print(client_info.certificate_chain_contents)

    # Inspect target-specific configurations
    for known_server in client_info.known_servers:
        print(known_server.server_name)
        print(known_server.server_mode)
        print(known_server.trusted_certificates_location)

if servers:
    # Read one server configuration
    server_info = nitlsconfig.ServerConfig(servers[0])
    print(server_info.service_name)
    print(server_info.certificate_mode)
    print(server_info.client_mode)
    print(server_info.certificate_chain_location.scheme)
    print(server_info.certificate_key_location.scheme)
    print(server_info.trusted_certificates_location.scheme)
    print(server_info.trusted_certificates_contents)
    print(server_info.certificate_key_contents)

    # Enumerate trusted certificates
    for cert in server_info.trusted_certificates:
        print(cert.display_name)
        print(cert.trusted_certificate_location.path)
        print(cert.trusted_certificate_contents)

Release files for nitlsconfig 1.0.0a2

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

Source distribution (sdist)

Source distribution for nitlsconfig 1.0.0a2
File Size Uploaded
nitlsconfig-1.0.0a2.tar.gz 18.7 kB Details

Built distribution (wheel)

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

Total release size: 39.4 kB

Release files / nitlsconfig-1.0.0a2.tar.gz

Download URL nitlsconfig-1.0.0a2.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a1c5f1dff525378e2029ec2f2459bee2a35851cfd8d5a63e4c593dff09aa8dc2
BLAKE2b-256 checksum
How to use checksums
b7acbb19862885be04c312ccadc25a305b05a6afa1c19c050e9d1dfcd636fe2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 25, 2026.

Transparency log

Release files / nitlsconfig-1.0.0a2-py3-none-any.whl

Download URL nitlsconfig-1.0.0a2-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc64aa2b6448bc0200b27ed59a257ab09197249f655e38149603023741f55377
BLAKE2b-256 checksum
How to use checksums
198db22bb8d331ab3bf22e15ea073b4c97080ace050a740fb3e1905480836407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 25, 2026.

Transparency log
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