Skip to content

Mypy-protobuf

open source tools to generate mypy stubs from protobufs.

설치 방법

pip install mypy-protobuf

사용 방법

protoc --python_out=output/location --mypy_out=output/location

또는

protoc --plugin=protoc-gen-mypy=path/to/protoc_gen_mypy.bat --python_out=output/location --mypy_out=output/location

와 같이 사용한다.

GRPC 연동

This plugin provides stubs generation for grpcio generated code.

protoc \
    --python_out=output/location \
    --mypy_out=output/location \
    --grpc_out=output/location \
    --mypy_grpc_out=output/location

See also

Favorite site