python-betterproto
python-betterproto copied to clipboard
Clean, modern, Python 3.6+ code generator & library for Protobuf 3 and async gRPC
We can replace isoparse conditionally with https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat. Requires a small change to the pyproject.toml as well. Should remove dep on six which makes my brain light up.
Betterproto currently is using some `typing` imports that are now deprecated, though they are noted in the Python docs to be guaranteed to remain until at least 3.14. For more...
https://beta.ruff.rs Config example: ```toml # pyproject.toml [tool.ruff] # https://beta.ruff.rs/docs/rules line-length = 88 # Default select = ["ALL"] ignore = [ # "D203", # "D213", "D", "RUF009", # See `extend-immutable-calls` "ERA001",...
The google GRPC compiler copies the comments made in the proto files to their .py counter parts. For code documentation it would be great if the betterproto compiler could also...
When converting existing code to use this module over standard protobuf, one issue raised was the lack of `ParseFromString`. This has already been mentioned at #323, with a PR in...
Versions ``` betterproto[compiler]==2.0.0b6 grpcio-tools pydantic==1.10.8 ``` I get the following error on the server side: ``` 023-07-10 15:48:08,980 - 140154842511168 - server.py-server:468 - ERROR: Application error Traceback (most recent call...
Here the template as example: ``` message Test { google.protobuf.Struct data = 1; } ``` So, the idea is to add a function to cast a python dictionary in the...
Optional fields generate very long and repetitive code. The idea is to use shorter and simpler code, and internally consider it as a field having `optional=True, group=f"_{field_name}"`. Related to #459....
As a basic example I have the below, the generated service will not import the `test` package, however if i reference any message in the return it imports it correctly....
Certainly I had the same issue with the original protoc compiler, but generated relative imports are complaining. I have a bunch of protos in the same directory. I'm using the...