bpack.st module

Struct based codec for binary data structures.

class bpack.st.Codec(descriptor, codec=None, decode_converters=None, encode_converters=None)[source]

Bases: bpack.codecs.BaseStructCodec

Struct based codec.

Default byte-order: MSB.

baseunits: bpack.enums.EBaseUnits = 'bytes'
bpack.st.Decoder

alias of bpack.st.Codec

bpack.st.Encoder

alias of bpack.st.Codec

bpack.st.codec(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.

bpack.st.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.

bpack.st.encoder(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.