Library for encoding and decoding protobuf messages without needing a .proto type definition. It infers the schema automatically and supports repeated fields, enums, and nested messages. Current version 1.4.2, supports Python 3.8+, released irregularly.
pip install bbpbVerified import paths — ran on the pinned version, not inferred.
Decode and encode protobuf binary data without a .proto file. The library infers a type definition (typedef) that can be reused for encoding.
Update code to handle dict: result = decode_message(blob); data = result['data']; typedef = result['typedef']
Test against known messages; verify round-trip encoding/decoding. For complex schemas, consider using actual .proto files.
Replace decode_message_with_type(blob, typedef) with decode_message(blob, typedef). Note the return format change.
Use integer keys: data[1] not data['1']. The typedef dict uses string keys for field numbers.