Bytemaker documentation¶
Version: 0.9.2
Useful links: Source Repository | Issue Tracker
What is it?¶
bytemaker is a Python 3.8-compatible library for byte serialization/deserialization. It brings C bitfield functionality over to Python version 3.8+. To that end, it provides methods and types for converting @dataclass-decorated classes.
What can you do with it?¶
bytemaker gives you the following:
A
BitVectorclass analogous to Python’sbytesandbytearrayclasses, but for sub-byte bit quantities.BitVectorreadily supports conversion between bit representations and various C customizable data types.A set of
bittypesclasses, including various-sized buffers, unsigned/signed ints, floats, and strings, that have underlyingBitVectorrepresentations.Support for serializing/deserializing
@dataclass-decorated classes, where the annotations can bebittypess, standard-libraryCTypes (c_uint8,ctypes.STRUCTURE, etc.), or Python-defaultPyTypes (int,bool,str(char),float). Nested types? No problem!Automagic support for handling any of the aforementioned objects via
bytemaker.conversions.aggregate_types.to_bits_aggregate()andbytemaker.aggregate_types.from_bits_aggregate().
Quickstart guide
Use the quickstart guide to familiarize yourself with the basics of bytemaker.
For more in-depth details of the library, refer to the API reference.