title: How to run grpc-gateway for python
body: <p>I am grpc rookie and wanted to create a REST endpoint for health check of the grpc server. For this I decided to use grpc gateway.</p>
  <p>However, the <a href="https://grpc-ecosystem.github.io/grpc-gateway/" rel="nofollow noreferrer">example</a> in docs for grpc-REST gateway for proxying grpc to json are only given for Golang. But I have a backend of python and want to use Google Cloud Endpoints to make a gRPC based api that can <a href="https://cloud.google.com/endpoints/docs/grpc/transcoding" rel="nofollow noreferrer">transcode incoming REST requests</a>.</p>
  <p>I did find a manual method of annotation generation in this stackoverflow <a href="https://stackoverflow.com/questions/46131022/protocol-buffer-import-resolution">answer</a> . But I was wondering what is the best method of doing it. This is the sample .proto file I want to generate into a class.</p>
  <pre><code> syntax = &quot;proto3&quot;;
   package example;
  +
  +import &quot;google/api/annotations.proto&quot;;
  +
   message StringMessage {
     string value = 1;
   }
  
   service YourService {
  -  rpc Echo(StringMessage) returns (StringMessage) {}
  +  rpc Echo(StringMessage) returns (StringMessage) {
  +    option (google.api.http) = {
  +      post: &quot;/v1/example/echo&quot;
  +      body: &quot;*&quot;
  +    };
  +  }
   }
  </code></pre>
  <p>How can I generate .proto files and create the grpc-gateway using python backend?</p>