gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Non-Google mode?

Open techdragon opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

  • I wanted to use this to generate code for my grpc service that used the https://github.com/googleapis/proto-plus-python library.

Describe the solution you'd like

  • A non-google mode where this compiler plugin just generates code like the current protoc compiler does... such as not requiring an unnecessary package definition in the proto file and thus generating a full python package containing lots of erroneous google information generated throughout the files, like google copyright statements and a readme talking about google cloud platform projects....

Describe alternatives you've considered

  • Generating the code then just heavily refactoring it to make it work. Defeats the purpose of autogeneration
  • Using the existing protoc python generator. If I was happy with it, I wouldn't have looked for alternatives

Additional context

  • If this is meant for just generating google apis... thats fine... it should just say so though. The project readme currently implies this can be used to generate grpc service code... but it seems to currently be too closely coupled to its use generating google api client code.

    This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library.

techdragon avatar Mar 05 '24 05:03 techdragon

FWIW I wrote a code generator which generates idiomatic python dataclasses which wrap the official protobuf python objects. I've been successfully using this for a project. But don't have time to maintain if officially. https://github.com/xxgreg/python-protodc

I use this to generate protojson requests which are used to communicate with a ConnectRPC service.

I'd definitely appreciate a supported official tool which works with proto-plus-python, as then I wouldn't need to continue maintaining this code.

xxgreg avatar Mar 05 '24 23:03 xxgreg