Skip to main content

Model driven genration - from UML to Code & Docs

Project description

Test PyPI

pyMDG

Overview

Parser and tools to manipulate UML models. Current version supports Sparx EA Generated XMI 2.1 or diagrams.net XML

Used to parse model files to native python classes (see metamodel below) which are passed to jinja2 templates for generation of code (POJO, POCO, Django etc), JSON data and HTML documentation.

Quickstart and docs can be found here: readthedocs

Test

Standard testing:

python -m unittest

To generate code call the generate script and pass in the recipie folder. A sample recipie folder is provided in the github repo:

python generate.py ./sample_recipie/config-drawio-django.yaml

Or once installed into site-packages via 'pip install pymdg', an executable is provided:

cd /my/recipie/folder

And execute:

mdg_generate <my/config.yaml>

See the sample_recipie configs for examples

Sparx EA Export Process

  • In Sparx select the domain root node (e.g. Model/Sample )
  • Select the publish tab at the top
  • Select Publish As... from top menu
  • Set export type as XMI 2.1
  • Optionally select 'Export Diagrams', 'Generate Diagram Images' and PNG format
  • Export to folder where you want to generate from

Wiki documentation upload

If your generation recipie has created a file for your wiki (Confluence) then an uploader utilitity can be used. This assumes that you have done the XMI export from Sparx EA with export diagrams and generate diagram images. To generate a confluence token please see: https://confluence.atlassian.com/cloud/api-tokens-938839638.html

python confluence.py {your email} {your confluence token} {confluence page id} {path to images}

Nomenclature:

This diagram shows all the features and how to model in UML Nomenclature

Sample model

Sample model

Metamodel

This diagram shows the internal classes which are passed to the templates during generation. Metamodel

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

pymdg-0.1a7.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymdg-0.1a7-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file pymdg-0.1a7.tar.gz.

File metadata

  • Download URL: pymdg-0.1a7.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pymdg-0.1a7.tar.gz
Algorithm Hash digest
SHA256 85a1d6180e9802481c553d9d7bd944d3dea0996558d888c817cfe8926e0f71da
MD5 8b159c24433b38c902f1cb3a3e65706f
BLAKE2b-256 ecca5732e26bcab111beaa32cd2a7acd8bcd79ac8795726d2a09e9483e88d68b

See more details on using hashes here.

File details

Details for the file pymdg-0.1a7-py3-none-any.whl.

File metadata

  • Download URL: pymdg-0.1a7-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pymdg-0.1a7-py3-none-any.whl
Algorithm Hash digest
SHA256 35fe998e68d8381401a2a69db09660b7e4b68311d391570a3e0add63b15f7980
MD5 b000dbe8540602e0a6e768b51674ca40
BLAKE2b-256 a56d217a60bd1c93ba4764047fcf407470a7e5640e9283686be0c085f9ec6ac6

See more details on using hashes here.

Supported by

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