
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
protobuf-uml-diagram
Advanced tools
A tool to generate UML diagrams from Protobuf compiled .proto files.
Usage:
$ protobuf-uml-diagram --proto "cylc.flow.ws_messages_pb2" --output /tmp/
Logging output:
INFO:__main__:Importing compiled proto cylc.flow.ws_messages_pb2
INFO:__main__:Writing PNG diagram to /tmp/ws_messages_pb2.png
Image output:
$ pip install protobuf-uml-diagram
(…)
$ file issue_10.proto # See ./test_data/ or use your own .proto file.
issue_10.proto: ASCII text
$ protoc --python_out=./ issue_10.proto
$ # The line below modifies PYTHONPATH, which is not necessary if you have a valid Python module/package.
$ PYTHONPATH=. protobuf-uml-diagram --proto issue_10_pb2 --output /tmp
INFO:protobuf_uml_diagram:Imported: issue_10_pb2
INFO:protobuf_uml_diagram:Writing diagram to /tmp/issue_10_pb2.png
$ eog /tmp/issue_10_pb2.png
Running the command above should create a final image with your diagram as seen below.
By default, it uses the full name of the types (e.g. SomeRequest.shipments
).
If you would like to use simpler names (i.e. shipments
) you can use the option added
in 0.13 --full_names=true|false
(it is true
by default for backward compatibility).
$ PYTHONPATH=. protobuf-uml-diagram --proto issue_10_pb2 --output /tmp --full_names=false
INFO:protobuf_uml_diagram:Imported: issue_10_pb2
INFO:protobuf_uml_diagram:Writing diagram to /tmp/issue_10_pb2.png
$ eog /tmp/issue_10_pb2.png
Note that doing so, you risk showing fields that are homonyms but that mean different things. See the related issues #10 and #78.
$ pip install protobuf-uml-diagram
$ protobuf-uml-diagram
$ git clone https://github.com/kinow/protobuf-uml-diagram.git
$ cd protobuf-uml-diagram
$ pip install -e .
$ protobuf-uml-diagram
Generate UML diagrams from all (not compiled) .proto
files in a directory:
./dockerbuild.sh
./dockerrun.sh <path_containing_proto_files> <output_path>
Apache License
FAQs
Create UML diagrams from Protobuf proto files
We found that protobuf-uml-diagram demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.