MessageCodec.encode

MessageCodec.encode(message)[source]

Encode a message to the codec’s representation format.

Parameters:
messageMessage or dict or object

Message to encode. Can be a Message instance, a dict, or an object implementing the COMPAS data framework.

Returns:
bytes or str

Encoded representation of the message.