python-cwlgen is now deprecated, please use cwl-utils >= 0.4.
from cwl_utils import parser_v1_0 # You could alias this as cwlgen to simplify the migration from cwl_utils import parser_v1_0 as cwlgen
get_dict() → save()
parse_dict→ No super clear analogue, but loaded through
_UnionLoader((CommandLineToolLoader, ...workflow + other loaders)
- No more special field names, eg:
input_id| etc →
Classes aren’t nested anymore, ie:
Take care if you’re migrating to a newer spec, as some classes might have changed names (notably:
Don’t forget to catch all references of cwlgen, as missing one (or using mismatch versions of the parser) will cause:
raise RepresenterError('cannot represent an object: %s' % (data,)) ruamel.yaml.representer.RepresenterError: cannot represent an object: <cwlgen.common.CommandInputArraySchema object at 0x1100a5780>
If you have issues with the migration, please see this thread or raise an issue on CWLUtils.
Python-cwlgen is a python library for the programmatic generation of CWL v1.0. It supports the generation of CommandLineTool and Workflows.
The library works for both Python 2.7.12+ and 3.6.0+.
You can install Python-CWLGen through pip with the following command:
pip install cwlgen
The classes very closely (if not exactly) mirror the CWL v1.0 specification. You can find more about their parameters in the following specifications: