braiins / bos-plus-api-demos

6 stars 4 forks source link

Generate better proto file output #1

Open b-rowan opened 9 months ago

b-rowan commented 9 months ago

As of right now, protoc compiles proto files into what is essentially a garbled mess of runtime generated nonsense. This may be applicable to C or other languages, but with pythons use of type hinting in nearly every modern IDE, this generates code that is exceptionally annoying to use in production.

I would highly suggest trying out the betterproto library for this, as it generates actual python code with type hints and proper classes. The library has a 2.0.0b6 version which is quite good, and has been in v2-beta for a few years now, but seems quite stable and is used by a lot of other projects.

Here is the link for it - https://github.com/danielgtaylor/python-betterproto

luciusmagn commented 8 months ago

Good suggestion, Brett! I'll take a look