cwl-loader provides utilities to load CWL documents (local files, URLs, streams, or strings) into cwl-utils object models, normalize references, and sort dependency graphs.
pip install cwl-loaderLoad a CWL document from a URL or local path:
from cwl_loader import load_cwl_from_location
process = load_cwl_from_location("workflow.cwl")Load from in-memory text:
from cwl_loader import load_cwl_from_string_content
content = """
cwlVersion: v1.2
class: CommandLineTool
id: example-tool
baseCommand: echo
inputs: []
outputs: []
"""
process = load_cwl_from_string_content(content)Dump back to YAML:
from cwl_loader import dump_cwl
with open("normalized.cwl", "w", encoding="utf-8") as out:
dump_cwl(process, out)Run tests:
task testOr directly with Hatch:
hatch run test:testRun code quality checks:
task check
task lintProject documentation is published at: https://Terradue.github.io/cwl-loader/
Issues and pull requests are welcome: https://github.com/eoap/cwl-loader/issues
Licensed under the Apache License 2.0.