The 12 Patterns diagrams¶
In [1]:
Copied!
pip install eoap_cwlwrap
pip install eoap_cwlwrap
Requirement already satisfied: eoap_cwlwrap in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (0.31.0)
Collecting click==8.4.1 (from eoap_cwlwrap) Using cached click-8.4.1-py3-none-any.whl.metadata (2.6 kB)
Collecting cwl-loader==0.22.0 (from eoap_cwlwrap) Using cached cwl_loader-0.22.0-py3-none-any.whl.metadata (3.1 kB) Collecting cwl-utils==0.41 (from eoap_cwlwrap) Using cached cwl_utils-0.41-py3-none-any.whl.metadata (8.5 kB) Requirement already satisfied: loguru==0.7.3 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from eoap_cwlwrap) (0.7.3) Requirement already satisfied: session-adapters==0.3.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from eoap_cwlwrap) (0.3.0) Requirement already satisfied: cwltool==3.1.20260315121657 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-loader==0.22.0->eoap_cwlwrap) (3.1.20260315121657) Requirement already satisfied: ruamel-yaml<0.20,>=0.17.6 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-loader==0.22.0->eoap_cwlwrap) (0.19.1) Requirement already satisfied: cwl-upgrader>=1.2.3 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-utils==0.41->eoap_cwlwrap) (1.2.15) Requirement already satisfied: packaging in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-utils==0.41->eoap_cwlwrap) (26.2) Requirement already satisfied: rdflib in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-utils==0.41->eoap_cwlwrap) (7.6.0) Requirement already satisfied: requests in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-utils==0.41->eoap_cwlwrap) (2.34.2) Requirement already satisfied: schema-salad<9,>=8.8.20250205075315 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-utils==0.41->eoap_cwlwrap) (8.9.20260417192335) Requirement already satisfied: typing-extensions>=4.10.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwl-utils==0.41->eoap_cwlwrap) (4.16.0) Requirement already satisfied: prov==1.5.1 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (1.5.1) Requirement already satisfied: mypy-extensions in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (1.1.0) Requirement already satisfied: psutil>=5.6.6 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (7.2.2) Requirement already satisfied: coloredlogs in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (15.0.1) Requirement already satisfied: pydot>=1.4.1 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (4.0.1) Requirement already satisfied: argcomplete>=1.12.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (3.7.0) Requirement already satisfied: pyparsing!=3.0.2 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (3.3.2) Requirement already satisfied: spython>=0.3.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (0.3.14) Requirement already satisfied: rich-argparse in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (1.8.0) Requirement already satisfied: lxml in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from prov==1.5.1->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (6.1.1) Requirement already satisfied: networkx in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from prov==1.5.1->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (3.6.1) Requirement already satisfied: python-dateutil in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from prov==1.5.1->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (2.9.0.post0) Requirement already satisfied: six>=1.9.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from prov==1.5.1->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (1.17.0) Requirement already satisfied: boto3 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from session-adapters==0.3.0->eoap_cwlwrap) (1.43.57) Requirement already satisfied: oras in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from session-adapters==0.3.0->eoap_cwlwrap) (0.2.42) Requirement already satisfied: pydantic in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from session-adapters==0.3.0->eoap_cwlwrap) (2.13.4) Requirement already satisfied: mistune<3.3,>=3 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from schema-salad<9,>=8.8.20250205075315->cwl-utils==0.41->eoap_cwlwrap) (3.2.1) Requirement already satisfied: CacheControl<0.15,>=0.13.1 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from CacheControl[filecache]<0.15,>=0.13.1->schema-salad<9,>=8.8.20250205075315->cwl-utils==0.41->eoap_cwlwrap) (0.14.4) Requirement already satisfied: msgpack<2.0.0,>=0.5.2 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from CacheControl<0.15,>=0.13.1->CacheControl[filecache]<0.15,>=0.13.1->schema-salad<9,>=8.8.20250205075315->cwl-utils==0.41->eoap_cwlwrap) (1.2.1)
Requirement already satisfied: filelock>=3.8.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from CacheControl[filecache]<0.15,>=0.13.1->schema-salad<9,>=8.8.20250205075315->cwl-utils==0.41->eoap_cwlwrap) (3.32.0) Requirement already satisfied: charset_normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from requests->cwl-utils==0.41->eoap_cwlwrap) (3.4.9) Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from requests->cwl-utils==0.41->eoap_cwlwrap) (3.18) Requirement already satisfied: urllib3<3,>=1.26 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from requests->cwl-utils==0.41->eoap_cwlwrap) (2.7.0) Requirement already satisfied: certifi>=2023.5.7 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from requests->cwl-utils==0.41->eoap_cwlwrap) (2026.7.22) Requirement already satisfied: botocore<1.44.0,>=1.43.57 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from boto3->session-adapters==0.3.0->eoap_cwlwrap) (1.43.57) Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from boto3->session-adapters==0.3.0->eoap_cwlwrap) (1.1.0) Requirement already satisfied: s3transfer<0.20.0,>=0.19.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from boto3->session-adapters==0.3.0->eoap_cwlwrap) (0.19.2) Requirement already satisfied: humanfriendly>=9.1 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from coloredlogs->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (10.0) Requirement already satisfied: jsonschema in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from oras->session-adapters==0.3.0->eoap_cwlwrap) (4.26.0) Requirement already satisfied: attrs>=22.2.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from jsonschema->oras->session-adapters==0.3.0->eoap_cwlwrap) (26.1.0) Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from jsonschema->oras->session-adapters==0.3.0->eoap_cwlwrap) (2025.9.1) Requirement already satisfied: referencing>=0.28.4 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from jsonschema->oras->session-adapters==0.3.0->eoap_cwlwrap) (0.37.0) Requirement already satisfied: rpds-py>=0.25.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from jsonschema->oras->session-adapters==0.3.0->eoap_cwlwrap) (2026.6.3) Requirement already satisfied: annotated-types>=0.6.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from pydantic->session-adapters==0.3.0->eoap_cwlwrap) (0.8.0) Requirement already satisfied: pydantic-core==2.46.4 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from pydantic->session-adapters==0.3.0->eoap_cwlwrap) (2.46.4) Requirement already satisfied: typing-inspection>=0.4.2 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from pydantic->session-adapters==0.3.0->eoap_cwlwrap) (0.4.2) Requirement already satisfied: rich>=11.0.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from rich-argparse->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (15.0.0) Requirement already satisfied: markdown-it-py>=2.2.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from rich>=11.0.0->rich-argparse->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (4.2.0) Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from rich>=11.0.0->rich-argparse->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (2.20.0)
Requirement already satisfied: mdurl~=0.1 in /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages (from markdown-it-py>=2.2.0->rich>=11.0.0->rich-argparse->cwltool==3.1.20260315121657->cwl-loader==0.22.0->eoap_cwlwrap) (0.1.2) Using cached click-8.4.1-py3-none-any.whl (116 kB) Using cached cwl_loader-0.22.0-py3-none-any.whl (14 kB) Using cached cwl_utils-0.41-py3-none-any.whl (462 kB)
Installing collected packages: click, cwl-utils, cwl-loader Attempting uninstall: click Found existing installation: click 8.4.2 Uninstalling click-8.4.2:
Successfully uninstalled click-8.4.2
Attempting uninstall: cwl-utils Found existing installation: cwl-utils 0.42 Uninstalling cwl-utils-0.42: Successfully uninstalled cwl-utils-0.42
━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils]
━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils]
━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils]
━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils]
Attempting uninstall: cwl-loader ━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils] Found existing installation: cwl-loader 0.23.0 ━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils] Uninstalling cwl-loader-0.23.0: ━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils] Successfully uninstalled cwl-loader-0.23.0 ━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 [cwl-utils]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3/3 [cwl-loader] ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. cwl2ogc 0.19.0 requires cwl-utils==0.42, but you have cwl-utils 0.41 which is incompatible. cwl2puml 0.46.0 requires click==8.4.2, but you have click 8.4.1 which is incompatible. cwl2puml 0.46.0 requires cwl-loader==0.23.0, but you have cwl-loader 0.22.0 which is incompatible. cwl2puml 0.46.0 requires cwl-utils==0.42, but you have cwl-utils 0.41 which is incompatible. Successfully installed click-8.4.1 cwl-loader-0.22.0 cwl-utils-0.41
Note: you may need to restart the kernel to use updated packages.
In [2]:
Copied!
from cwl2puml import (
to_puml,
DiagramType
)
from eoap_cwlwrap import wrap_locations
from io import (
StringIO,
BytesIO
)
from IPython.display import (
display_markdown,
display_png,
Markdown
)
from plantuml import deflate_and_encode
from PIL import Image
from typing import List
from urllib.request import urlopen
from loguru import logger
import sys
logger.remove() #remove the old handler. Else, the old one will work along with the new one you've added below'
logger.add(sys.stderr, level="CRITICAL")
base_url = 'https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main'
directory_stage_in = f"{base_url}/templates/stage-in.cwl"
file_stage_in = f"{base_url}/templates/stage-in-file.cwl"
stage_out_cwl = f"{base_url}/templates/stage-out.cwl"
debug = False
for pattern_index in range(1, 13, 1):
display_markdown(Markdown(f"# Pattern {pattern_index}"))
workflow_id = f"pattern-{pattern_index}"
workflows_cwl = f"{base_url}/cwl-workflow/{workflow_id}.cwl"
cwl_document = wrap_locations(
workflows=workflows_cwl,
workflow_id=workflow_id,
directory_stage_in=directory_stage_in,
file_stage_in=file_stage_in,
stage_out=stage_out_cwl
)
for diagram_type in DiagramType:
display_markdown(Markdown(f"## {diagram_type.name.lower()} diagram"))
out = StringIO()
to_puml( # workflow_id='main' by default
cwl_document=cwl_document,
diagram_type=diagram_type,
output_stream=out
)
clear_output = out.getvalue()
if debug:
print(clear_output)
encoded = deflate_and_encode(clear_output)
diagram_url = f"https://uml.planttext.com/plantuml/png/{encoded}"
with urlopen(diagram_url) as url:
img = Image.open(BytesIO(url.read()))
display_png(img)
from cwl2puml import (
to_puml,
DiagramType
)
from eoap_cwlwrap import wrap_locations
from io import (
StringIO,
BytesIO
)
from IPython.display import (
display_markdown,
display_png,
Markdown
)
from plantuml import deflate_and_encode
from PIL import Image
from typing import List
from urllib.request import urlopen
from loguru import logger
import sys
logger.remove() #remove the old handler. Else, the old one will work along with the new one you've added below'
logger.add(sys.stderr, level="CRITICAL")
base_url = 'https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main'
directory_stage_in = f"{base_url}/templates/stage-in.cwl"
file_stage_in = f"{base_url}/templates/stage-in-file.cwl"
stage_out_cwl = f"{base_url}/templates/stage-out.cwl"
debug = False
for pattern_index in range(1, 13, 1):
display_markdown(Markdown(f"# Pattern {pattern_index}"))
workflow_id = f"pattern-{pattern_index}"
workflows_cwl = f"{base_url}/cwl-workflow/{workflow_id}.cwl"
cwl_document = wrap_locations(
workflows=workflows_cwl,
workflow_id=workflow_id,
directory_stage_in=directory_stage_in,
file_stage_in=file_stage_in,
stage_out=stage_out_cwl
)
for diagram_type in DiagramType:
display_markdown(Markdown(f"## {diagram_type.name.lower()} diagram"))
out = StringIO()
to_puml( # workflow_id='main' by default
cwl_document=cwl_document,
diagram_type=diagram_type,
output_stream=out
)
clear_output = out.getvalue()
if debug:
print(clear_output)
encoded = deflate_and_encode(clear_output)
diagram_url = f"https://uml.planttext.com/plantuml/png/{encoded}"
with urlopen(diagram_url) as url:
img = Image.open(BytesIO(url.read()))
display_png(img)
Pattern 1¶
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[2], line 38 34 35 workflow_id = f"pattern-{pattern_index}" 36 workflows_cwl = f"{base_url}/cwl-workflow/{workflow_id}.cwl" 37 ---> 38 cwl_document = wrap_locations( 39 workflows=workflows_cwl, 40 workflow_id=workflow_id, 41 directory_stage_in=directory_stage_in, TypeError: wrap_locations() got an unexpected keyword argument 'workflow_id'. Did you mean 'workflows'?