Registry / serialization / protobuf_decoder

protobuf_decoder

JSON →
library0.4.0pypypiunverified

A Python library to decode Protocol Buffers (protobuf) without requiring the original .proto file. It can parse raw binary data and output a human-readable structure. Current version: 0.4.0, released June 2023. Development appears low-activity but stable, with several releases since 2022.

pip install protobuf-decoder
INSTALL
IMPORT
SIG · PROTOBUF_DECODER
P
protobuf_decoder
serializationpythonv0.4.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ProtobufDecoder
from protobuf_decoder import ProtobufDecoder
from protobuf_decoder import ProtobufDecoder

Basic usage: decode a raw protobuf message to a list of decoded fields.

from protobuf_decoder import ProtobufDecoder # Example: decode a raw protobuf message raw_protobuf = b'\x08\x96\x01' # field 1, varint value 150 decoder = ProtobufDecoder(raw_protobuf) decoded = decoder.decode() print(decoded) # [{'field_number': 1, 'field_name': '1', 'field_type': 'VarintValue', 'value': 150}] # Or use the parse function directly from protobuf_decoder import parse decoded = parse(raw_protobuf) print(decoded) # same result
Debug
Known issues
gotchaThe library does not reconstruct .proto schema or generate human-readable field names. It only outputs field numbers and unknown field types. If you need field names, you must supply a .proto file (this lib doesn't support it).
fix
Use official protobuf compiler or schema-based tools for field name resolution.
affects: all
gotchaWhen using the ProtobufDecoder class, you must call .decode() to get the parsed fields. The constructor itself does not parse immediately.
fix
Always call .decode() on the decoder instance, or use the convenience `parse()` function.
affects: >=0.1.0
gotchaThe `to_dict()` method (added in v0.4.0) may return a flat dictionary with field numbers as string keys. It does not handle nested message structures perfectly; nested data may be represented as bytes or as sub-dictionaries depending on detection.
fix
Check the output carefully; consider using `strict_mode` parameter if available to control nested parsing.
affects: >=0.4.0
Upgrade
Version history
0.4.0latest on PyPI · released Feb 25, 2024
Audit
Dependencies
protobufrequiredUses Google's protobuf library internally for wire types and encoding
Agent activity
8 hits · last 30 days
node
8
Resources
protobuf_decoder — pip install protobuf_decoder · libregistry