Classes and utilities for packing/unpacking bytes.

[plum] Pack/Unpack Memory

Pipeline Status Coverage Report Documentation Status

The plum-py Python package provides classes and utility functions to efficiently pack and unpack bytes similar to what the standard library struct module offers. This package expands significantly on that capability with much more powerful and convenient access and control of bytes within a buffer (including handling variable size/type relationships within the buffer data).

The package provides a large number of fundamental types (e.g. numbers, structures, arrays, etc.) for specifying buffer data structure. Each type conforms to a “plug-and-play” architecture facilitating the ability to be combined in any way, including deeply nested structures of arbitrary type. You may also write your own custom types that conform to the “plug-and-play” architecture API and use them in combination with any of the fundamental types provided.

Features include:

See the Quick Start to learn the basics and the Tutorials for more complete usage examples. The following summarizes the plum types available in this package.

Plum Type Description
plum.array list of uniformly typed
plum.bytearray array of bytes
plum.float floating point integers integer with bit field accessors integer enumerated constants integer with bit flags
plum.items collection of uniquely typed items
plum.ipv4 IPV4 address
plum.nil no bytes
plum.str strings
plum.structure predefined structure of uniquely typed members