Classes and utilities for packing/unpacking bytes.
[plum] Pack/Unpack Memory¶
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:
- Easy to Create Custom Types
- Visual Memory Summaries
- Arbitrary Nesting
- Companion Performance plum-boost Package
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 plum.int integers plum.int.bitfields integer with bit field accessors plum.int.enum integer enumerated constants plum.int.flag 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