8000 GitHub - darkdarkfruit/grpc-pytools: Some useful Python's gRPC tools.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

darkdarkfruit/grpc-pytools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-pytools

Some useful Python's gRPC tools.

Prerequisites

Install gRPC tools:

$ pip install grpcio-tools

See gRPC Python Quickstart for more details.

Installation

Install grpc-pytools:

$ pip install grpc-pytools

Usage

Plugins

AST-like JSON

Generate an AST-like JSON file from the .proto file:

$ python -m grpc_tools.protoc -I. --pytools-ast_out=. xx.proto

Tools

Pythonic services

Generate more Pythonic services for all gRPC services defined in the xx_pb2.py file (generated by grpcio-tools):

$ python -m grpc_pytools.pythonic --proto-ast-file=/path/to/xx_ast.json --pb2-module-name=python.path.to.xx_pb2

Marshmallow schemas

Generate Marshmallow schemas for all gRPC messages defined in the xx_pb2.py file:

$ python -m grpc_pytools.marshmallow --proto-ast-file=/path/to/xx_ast.json --pb2-module-name=python.path.to.xx_pb2

RESTArt APIs

Generate simple RESTArt APIs for all gRPC methods defined in the xx_pb2.py file:

$ python -m grpc_pytools.restart --proto-ast-file=/path/to/xx_ast.json --pb2-module-name=python.path.to.xx_pb2 --grpc-server=localhost:50051

Examples

See examples to find out how to generate a simple JSON proxy for gRPC services.

License

MIT

About

Some useful Python's gRPC tools.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.0%
  • Makefile 1.0%
0