Skip to content

Native Pythonic generator for CWL processes (CLIs & workflows)

Michael R. Crusoe edited this page Nov 8, 2016 · 6 revisions

Proposal by Niels Drost & Michael R. Crusoe:

Python API to generate Python objects that wrap a CWL Process (a CommandLineTool, Workflow, or ExpressionTool)

Can be used to configure and run that Process in a Pythonic way

Useful in Jupyter Notebooks

A notebook that intersperses running these CWL Processes with their own computation could be exported into a pure CWL workflow with the in between steps turned into Python scripts (wrapped in a CWL CommandLineTool).

Pseudocode

helloworld = cwlWrap("helloworld.cwl")
result = helloworld(name="Fred")
print result["greeting"]

Hello, Fred!

Actual code

import cwltool.factory
f = cwltool.factory.Factory()
echo = f.make("v1.0/v1.0/echo-tool.cwl")
out = echo(in="foo")

Related