Decode protobuf without proto file
Project description
Protobuf Decoder
Simple protobuf decoder for python
Motivation
The goal of this project is decode protobuf binary without proto files
A Simple Example
"""
# proto
message Test1 {
string a = 1;
}
# message
{
"a": "테스트"
}
# binary
0A 09 ED 85 8C EC 8A A4 ED 8A B8
"""
test_target = "0A 09 ED 85 8C EC 8A A4 ED 8A B8"
parsed_data = Parser().parse(test_target)
>> parsed_data
>> [ParsedResult(field=1, wire_type="string", data='테스트')]
"""
# proto
message Test1 {
int32 a = 1;
}
message Test2 {
Test1 b = 3;
}
# message
{
"a": {
"b": 150
}
}
# binary
1a 03 08 96 01
"""
test_target = "1a 03 08 96 01"
parsed_data = Parser().parse(test_target)
>> parsed_data
>> [ParsedResult(field=3, wire_type="length_delimited", data=[ParsedResult(field=1, wire_type="varint", data=150)])]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
protobuf_decoder-0.0.1.tar.gz
(1.7 kB
view hashes)
Built Distribution
Close
Hashes for protobuf_decoder-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8763403c4142eacee816d0fc858999aef39df6c0b1381926e6311b52fa6429ec |
|
MD5 | c92000933ea172e7741875281506a0a7 |
|
BLAKE2b-256 | 3bf0d0aefba1b6ac6e4ae60a721616eb13326092baac782b22d657edc9573113 |