Open makarr opened 2 months ago
Serialized Protobuf bytes doesn't contain scheme data, is it even possible to decode protobuf bytes without source proto file?
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?
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()
formsgspec.msgpack.encode()
.