Skip to main content

Create UML diagrams from Protobuf proto files

Project description

PyPI License CI codecov

ko-fi

Protobuf UML diagram

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:

example output

TL;DR

$ 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.

Installation

$ pip install protobuf-uml-diagram
$ protobuf-uml-diagram

Development

$ git clone https://github.com/kinow/protobuf-uml-diagram.git
$ cd protobuf-uml-diagram
$ pip install -e .
$ protobuf-uml-diagram

Docker

Generate UML diagrams from all (not compiled) .proto files in a directory:

./dockerbuild.sh
./dockerrun.sh <path_containing_proto_files> <output_path>

License

Apache License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protobuf-uml-diagram-0.11.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

protobuf_uml_diagram-0.11-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file protobuf-uml-diagram-0.11.tar.gz.

File metadata

  • Download URL: protobuf-uml-diagram-0.11.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for protobuf-uml-diagram-0.11.tar.gz
Algorithm Hash digest
SHA256 44325cfff4235b08e72ad4b1c4f6e0a3284f24a86bfc77b3cf71f40c26ed5ad5
MD5 0a364ae2dd48c8eab3c7be247fa12ceb
BLAKE2b-256 99c15daa20fa15331e0951d07d416ae4e8256d575f40c28352bb8de6a7f310cd

See more details on using hashes here.

File details

Details for the file protobuf_uml_diagram-0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for protobuf_uml_diagram-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 795d2666f623a9c369c87ac0467f8ab16b1d9f06ffe8e4e6780653058e34d897
MD5 69a9d6a6fed1bd5cfecfffe3f828330f
BLAKE2b-256 61dbab0094235630b6155443c5d8c890667db1e9774c74c4d870e0329c510a4e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page