bpack.ba module

Bitarray based codec for binary data structures.

class bpack.ba.Decoder(descriptor, converters=<function converter_factory>)[source]

Bases: bpack.codecs.Decoder

Bitarray based data decoder.

Only supports “big endian” byte-order and MSB bit-order.

decode(data: bytes)[source]

Decode binary data and return a record object.

baseunits: bpack.enums.EBaseUnits = 'bits'
bpack.ba.decoder(cls)

Class decorator to add (de)coding methods to a descriptor class.

The decorator automatically generates a Codec object form the input descriptor class and attach to it methods for conversion form/to bytes.