mcap_protobuf.decoder module

class mcap_protobuf.decoder.Decoder[source]

Bases: object

Decodes Protobuf messages.

Deprecated since version 0.3.0: Use DecoderFactory with McapReader instead.

decode(schema: Schema, message: Message) Any[source]
class mcap_protobuf.decoder.DecoderFactory[source]

Bases: DecoderFactory

Provides functionality to an McapReader to decode protobuf messages. Requires valid protobuf schemas to decode messages.

decoder_for(message_encoding: str, schema: Schema | None) Callable[[bytes], Any] | None[source]

If the message encoding and schema arguments can be decoded by this decoder factory, returns a callable to decode message bytes.

exception mcap_protobuf.decoder.McapProtobufDecodeError[source]

Bases: McapError

Raised when a Message record cannot be decoded as a Protobuf message.