cwl2puml converts Common Workflow Language workflows into PlantUML diagrams.
It provides a Python API and a transpiler-mate plugin that write PlantUML source and optionally render PNG or SVG images through a PlantUML server.
activity, component, class, sequence, state,
ogc_processes_inputs, and ogc_processes_outputs.
- Python
>=3.10
Install Hatch and Taskfiles and then install the Git hook:
task quality:pre-commit:installEvery commit runs Ruff (including the configured McCabe complexity limit), Ruff formatting, mypy checks, Bandit security checks, and the pytest suite. Run the complete hook explicitly with:
task quality:pre-commit:runFor command-line use, install the runtime and plugin together:
pip install transpiler-mate-runtime "cwl2puml>=0.48.0"For the Python library alone, use pip install cwl2puml. To install the current
checkout, use pip install ..
Note
Since release 0.48.0, cwl2puml is a transpiler-mate plugin.
The standalone command was removed; use transpiler-mate cwl2puml.
The Python library remains available.
transpiler-mate cwl2puml --help
transpiler-mate cwl2puml --output ./out 'workflow.cwl#main'Omit #main to render all workflows. Select diagram types by repeating
--diagrams, and optionally request images:
transpiler-mate cwl2puml \
--diagrams component \
--diagrams sequence \
--output ./out \
--convert-image \
--image-format svg \
'workflow.cwl#main'The plugin writes <output>/<workflow.id>/<diagram>.puml, plus .png or .svg
files when image conversion is enabled. The default output directory is
./docs; images are disabled by default. All seven diagram types are selected
unless --diagrams is supplied.
Start with the first-diagram tutorial, or see the command-line guide and Python guide for specific tasks. Options and API signatures are in the reference.
Install Hatch with pip install hatch, then run the test matrix:
hatch run test:testRun coverage:
hatch run test:test-covFormat the code:
hatch run dev:lintRun Ruff fixes:
hatch run dev:checkProject documentation: https://Terradue.github.io/cwl2puml/
To preview the documentation locally, use an isolated environment:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install mkdocs mkdocs-mermaid2-plugin mkdocs-jupyter "mkdocstrings[python]" pymdown-extensions
mkdocs serveRun mkdocs build --strict to validate the documentation. Notebook pages use
their saved outputs; regenerate those outputs in Jupyter when updating examples.
Open an issue at https://github.com/Terradue/cwl2puml/issues if you find a bug or want to propose a change.