Skip to main content

Python utilities for Tahu & Sparkplug B.

Project description

TahUtils

A small wrapper package for using Tahu for Sparkplug B in Python. Comes with an unmodified (barring import structure) Tahu included, hence the use of the Eclipse license.

Examples

See the examples directory in the project repository.

Current Support

  • Generating Sparkplug B topics
  • Generating birth, death, and data payloads for nodes (not tested for devices)
  • Managing aliases
  • Using enums for metric names

Goals

  • Parse message handling

Updating Tahu Version

Assuming no major refactoring to the tahu library, updating the included tahu consists of the following steps:

  1. Download the latest release from the repository: https://github.com/eclipse/tahu/tags

  2. Extract the source code.

  3. Regenerate the sparkplug_b_pb2.py file per the instructions in tahu-<version>/python/core/README.md. Use tahu-<version>/python/core as your working directory when executing the command, and you'll need the protobuf compiler.

  4. Copy the contents of the tahu-<version>/python/core directory to the tahutils/tahu directory.

  5. Overwrite the tahutils/tahu/__init__.py file with the appropriate imports, typically:

    from . import sparkplug_b_pb2
    from . import array_packer
    from . import sparkplug_b
    
  6. Modify the imports in tahutils/tahu/sparkplug_b.py to include the tahu package name:

    import tahutils.tahu.sparkplug_b_pb2 as sparkplug_b_pb2
    import time
    from tahutils.tahu.sparkplug_b_pb2 import Payload
    from tahutils.tahu.array_packer import *
    

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

tahutils-0.1.0a1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

tahutils-0.1.0a1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file tahutils-0.1.0a1.tar.gz.

File metadata

  • Download URL: tahutils-0.1.0a1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for tahutils-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 40785a1cb62114d1cca4fecbbaf5095d230693a66ce2908d646c598f4a1e2b3e
MD5 a187be7562ee6498fa621c5751298894
BLAKE2b-256 62f37138beb22ca917ba9103c00f609943cdbe2e5f6bcbb6f6c6ad50ea3d5ef2

See more details on using hashes here.

File details

Details for the file tahutils-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: tahutils-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for tahutils-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 0936ae02c65524eb95d687ceb4650a409ca9d6a1ef3eb9d3da1879147286e61f
MD5 de0803f3e1bfa5346fe21e056105ebed
BLAKE2b-256 28da0e4e80cb3902dc7308122f65c33da21eb0aea8c27f1bf946aca645a89f96

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