Skip to main content

tpm_multicast_client

Versions Code style: black Test codecov

Listens to the TPM multicast stream and unpack the data into a status dictionary. This is a Python-only implementation of Jeff Hagen's tpmdgram.c.

Installation

To install with pip do

pip install sdss-tpm-multicast-client

To install from source do

pip install .

or, for development,

poetry install

More information on developing with Poetry can be found here.

Usage

The library provides a single function, listen_to_multicast, that creates a connection to the TPM broadcast, unpacks the datagram, and passes it to a callback function. A basic example

from pprint import pprint

from tpm_multicast_client import __version__, listen_to_multicast


def pprint_datagram(data: dict):
    pprint(data)

async def main():
    _, protocol = await listen_to_multicast(pprint_datagram)
    await protocol.run_forever()


if __name__ == "__main__":
    main()

The callback, pprint_datagram in this case, can be a function or a coroutine. In the former case it will be called with loop.call_soon(). In the latter the coroutine is scheduled as a task.

CLI

The library provides a simple CLI script tpm-multicast-client that prints the output of the datagram to stdout. It's basically equivalent to the example above.

Metadata

Release files for sdss-tpm-multicast-client 0.3.1

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

Source distribution (sdist)

Source distribution for sdss-tpm-multicast-client 0.3.1
File Size Uploaded
sdss_tpm_multicast_client-0.3.1.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sdss-tpm-multicast-client 0.3.1
File Interpreter ABI Platform
sdss_tpm_multicast_client-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / sdss_tpm_multicast_client-0.3.1.tar.gz

Download URL sdss_tpm_multicast_client-0.3.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bb3052dcc838fc43699f4f856f517874156657fda00c2bcf7dce63991ef903dd
BLAKE2b-256 checksum
How to use checksums
8d964ec0aebfbe5c5cf550f905b1dcace5c90895462fbe0a258d0dcf1785e7b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / sdss_tpm_multicast_client-0.3.1-py3-none-any.whl

Download URL sdss_tpm_multicast_client-0.3.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2af843603ad2a39e6cfee6d42107f1824c650ab35dff5be45bc984768f392c2
BLAKE2b-256 checksum
How to use checksums
3253232b0872387dabbc81004f23ecc1bbe15f4aff46eb4cd252f38ad9212ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

10 release files

0.1.0

9 release files

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