GitHunt
SO

software-dov/protoc-docs-plugin

A protoc plugin that appends docstrings to Message subclasses on the default Python pb2 generated output.

protoc-docs-plugin

This is a protoc plugin intended to augment protoc's default Python
output with docstrings. It has been loosely designed to be able to support
docstrings for other langauges also, but this is contingent upon the
availability of appropriate insertion points in those languages.

Installation & Dependencies

This package depends on the current version of protobuf and pypandoc
from PyPI.

$ pip install protoc-docs-plugin

Additionally, this package also depends on the pandoc OS package, which
you will need to install from your OS package manager.

While it will run standalone as well, it only ever actually makes sense
to invoke it from protoc.

Usage

Add --pydocstring_out to the same command to protoc that has a previous
--python_out directive.

Example:

$ protoc foo.proto --python_out=. --pydocstring_out=.

Order does matter here; protoc must write the plain Python output first
before it can augment it with the output from this plugin.

More Information

Languages

Python89.6%Starlark10.4%

Contributors

Apache License 2.0
Created January 8, 2020
Updated February 7, 2020