Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf support #715

Open
makarr opened this issue Aug 3, 2024 · 2 comments
Open

protobuf support #715

makarr opened this issue Aug 3, 2024 · 2 comments

Comments

@makarr
Copy link

makarr commented Aug 3, 2024

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().

@trim21
Copy link

trim21 commented Sep 21, 2024

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

@pablospe
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants