msgspec icon indicating copy to clipboard operation
msgspec copied to clipboard

protobuf support

Open makarr opened this issue 1 year ago • 2 comments

I'm using msgspec to shuttle data around where I'm often both the server and the client, meaning the schema is predefined and protobuf's extra compression would be nice. Taking a look at the protobuf Python library, msgspec sure looks a lot more friendly and it seems all that stuff could be handled with msgspec's pre-existing encoder / decoder hooks. It would be amazing to simply drop-in msgspec.protobuf.encode() for msgspec.msgpack.encode().

makarr avatar Aug 03 '24 15:08 makarr

Serialized Protobuf bytes doesn't contain scheme data, is it even possible to decode protobuf bytes without source proto file?

trim21 avatar Sep 21 '24 05:09 trim21

Maybe relevant. The following project generates Pydantic models from protobuf: https://github.com/danielgtaylor/python-betterproto?tab=readme-ov-file#generating-pydantic-models

I think the support has to be added there instead?

pablospe avatar Sep 27 '24 13:09 pablospe