This project is a library for generating UML diagrams from Python source code, and it includes a demonstration application.
The umlextensions module provides a flexible way to add capabilities to the core UML Diagrammer. There are extensions that read external data and convert it to a UML class diagram. An example is the InputPython extension that reads Python source code and generates an appropriate UML diagram. There are extensions that take an existing UML diagram and convert it to a different format. For example, the OutputGML extension produces GML files.
Finally, there are tool extensions that manipulate a UML diagram. Examples of these are:
- ToolOrthogonalLayout - Lays out shapes in a manner that minimizes link crossings and link bends.
- ToolOrthogonalRouting - Lays out links such that link bends are orthogonal.
- ToolSugiyama - Lays out shapes and links in a pleasing manner.
You can install the project using pip. It is recommended to do this in a virtual environment.
pip install umlextensionsThis project relies on several other packages. pip will handle the installation of these dependencies. They are listed here for your reference:
The primary way to use this project is as a library within a larger application. However, a demonstration application is included to showcase the functionality.
To run the demo application, follow these steps:
-
Clone the repository (if you haven't already):
git clone https://github.com/hasii2011/umlextensions.git cd umlextensions -
Install dependencies (it is recommended to use a virtual environment):
pip install -e . -
Run the demo application:
python tests/extensiondemo/ExtensionDemoApp.py
This will open a window titled "Demo UML Extensions".
-
In the "Demo UML Extensions" window, navigate to the menu bar and click Extensions → Input → Python File(s).
-
A file dialog will appear, allowing you to select one or more Python files. Select the files you want to include in your UML diagram and click Open.
-
After parsing the files, a dialog titled "Shape Layout Parameters" may appear, allowing you to adjust the layout of the UML shapes. You can accept the defaults or modify them as needed and click OK.
-
The application will then generate and display the UML class diagram based on the Python code in the selected files.
The project is designed to be used as a library. The umlextensions package is imported into the UML Diagrammer application. The ExtensionsManager class is the main entry point for discovering and running extensions. The UML Diagrammer integrates it by providing its own implementation of IExtensionsFacade.
Written by Humberto A. Sanchez II ©2026
For all kinds of problems, requests, enhancements, bug reports, etc., please drop me an e-mail.
Note
I do not consent to GitHub's use of this project's code in Copilot. See our GitHub Copilot Statement for details.