Recently I wanted to generate UML (Unified Modeling Language) diagrams of the structure of an existing codebase for the purpose of having an architecture discussion.
I was wondering if there was a tool to generate UML diagrams in Python to save me some manual work.
pyreverse: it comes installed with
pylint which is a very common development dependency in Python.
pyreverse enables you to point to the code you want UML diagrams of, here in my example I was generating a diagram of a project called
This produces in the same directory a graphviz file called
Then, provided you have graphviz (which provides the
dot command) installed:
dot -Tpng classes.dot -o securedrop_export.png
Which produces the following:
ExportStatus is an
TimeoutException is a custom exception (in red).