Welcome to pyMDG Documentation

Take UML models created in Sparx EA or DrawIO and use pyMDG to generate code, schema and documentation. Provided templates generate Django, OpenAPI, Avro, POJOs and more. If you create reusable templates or improve upon the provided ones, please submit them in GitHub.

Currently used for generating data platforms, API & Kafka schema via UML packages, classes & enumerations.


pyMDG has a few opinions on the way we data model. This nomenclature enables rule based declaration of things like API endpoints. This can be seen in the nomenclature reference documentation and also see the sample data models in the sample_recipies folder in the Git repo.


The github project comes with sample recipes which can generate a many artifacts including a Django Rest data platform. The generation is definied in recipies, see the sample_recipies or the recipies docs to see how they work.


git clone https://github.com/Semprini/pyMDG
cd pyMDG
virtualenv venv
. venv/bin/activate or .\venv\Scripts\activate
pip install -r requirements.txt
python -m mdg.tools.mdg_tool generate ./sample_recipe/drawio/config-drawio-django.yaml

Run the app:

cd build/sample_drawio_django/SampleIndustry
pip install -r requirements.txt
python manage.py makemigrations TestDomain TestDomain2
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

And browse to or

When installed via pip, and you’ve created your own project, pyMDG provides the mdg-tool command.

Indices and tables