cwl2puml converts Common Workflow Language workflows into PlantUML diagrams.
It provides a CLI that can:
- load a CWL workflow from a local path or URL
- render PlantUML source files
- optionally render PNG or SVG images through a PlantUML server
activitycomponentclasssequencestate
- 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, strict mypy checks, and the pytest suite. Run the complete hook explicitly with:
task quality:pre-commit:runInstall from the repository:
pip install .For development:
pip install hatchShow the CLI help:
cwl2puml --helpBasic example:
cwl2puml \
https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/cwl-workflow/pattern-1.cwl \
--workflow-id pattern-1 \
--output ./outThis writes one .puml file per diagram type into ./out.
Generate only selected diagrams:
cwl2puml workflow.cwl \
--workflow-id main \
--diagrams component \
--diagrams sequence \
--output ./outGenerate SVG images through a PlantUML server:
cwl2puml workflow.cwl \
--workflow-id main \
--diagrams component \
--output ./out \
--convert-image \
--image-format svgUse a custom PlantUML server host:
cwl2puml workflow.cwl \
--workflow-id main \
--output ./out \
--convert-image \
--puml-server uml.planttext.comFor each selected diagram type, the CLI writes:
<diagram>.puml- optionally
<diagram>.pngor<diagram>.svg
Run the test matrix:
hatch run test:test-qRun coverage:
hatch run test:test-covRun formatting checks:
hatch run dev:lintRun Ruff fixes:
hatch run dev:checkProject documentation: https://Terradue.github.io/cwl2puml/
Open an issue at https://github.com/Terradue/cwl2puml/issues if you find a bug or want to propose a change.