# Python classes for loading, manipulating CWL documents

This is the reference implementation of the Common Workflow Language. It is intended to be feature complete and provide comprehensive validation of CWL files as well as provide other tools related to working with CWL.

## Modules

Contents:

- API Reference
  - cwl_utils

## Included Utility Programs

### cwl-cite-extract

Print information about software used in a CWL document (Workflow or CommandLineTool). For CWL Workflows, all steps will also be searched (recursively).

    usage: cwl-cite-extract [-h] input

input

  Input CWL document (CWL Workflow or CWL CommandLineTool)

-h, --help

  show this help message and exit

### cwl-docker-extract

Save container images specified in a CWL document (Workflow or CommandLineTool). For CWL Workflows, all steps will also be searched (recursively).

    usage: cwl-docker-extract [-h] [--dir DIR] [-s]
                              [--container-engine CONTAINER_ENGINE]
                              [--force-download]
                              input

input

  Input CWL document (CWL Workflow or CWL CommandLineTool)

-h, --help

  show this help message and exit

--dir <dir>

  Directory in which to save images

-s, --singularity

  Use singularity to pull the image

--container-engine <container_engine>

  Specify which command to use to run OCI containers. Defaults to ‘docker’ (or ‘singularity’ if –singularity/-s is passed).

--force-download

  Force pulling a newer container.

### cwl-expression-refactor

Tool to refactor CWL documents so that any CWL expression are separate steps as either ExpressionTools or CommandLineTools. Exit code 7 means a single CWL document was provided but it did not need modification.

    usage: cwl-expression-refactor [-h] [--etools] [--skip-some1] [--skip-some2]
                                   dir inputs [inputs ...]

dir

  Directory in which to save converted files

inputs

  One or more CWL documents.

-h, --help

  show this help message and exit

--etools

  Output ExpressionTools, don’t go all the way to CommandLineTools.

--skip-some1

  Don’t process CommandLineTool.inputs.inputBinding and CommandLineTool.arguments sections.

--skip-some2

  Don’t process CommandLineTool.outputEval or CommandLineTool.requirements.InitialWorkDirRequirement.

### cwl-graph-split

Split a packed CWL document.

    usage: cwl-graph-split [-h] [-m MAINFILE] [-f {json,yaml}] [-p] [-C OUTDIR]
                           cwlfile

cwlfile

-h, --help

  show this help message and exit

-m <mainfile>, --mainfile <mainfile>

  Specify the name of the main document.

-f {json,yaml}, --output-format {json,yaml}

  Specify the format of the output CWL files.

-p, --pretty

  Beautify the output CWL document, only works with yaml format.

-C <outdir>, --outdir <outdir>

  Output folder for the unpacked CWL files.

### cwl-normalizer

Normalizes CWL documents. Will upgrade to CWL v1.2, and pack the result. Can optionally refactor out CWL expressions.

    usage: cwl-normalizer [-h] [--etools] [--skip-some1] [--skip-some2]
                          [--no-expression-refactoring]
                          dir inputs [inputs ...]

dir

  Directory in which to save converted files

inputs

  One or more CWL documents.

-h, --help

  show this help message and exit

--etools

  Output ExpressionTools, don’t go all the way to CommandLineTools.

--skip-some1

  Don’t process CommandLineTool.inputs.inputBinding and CommandLineTool.arguments sections.

--skip-some2

  Don’t process CommandLineTool.outputEval or CommandLineTool.requirements.InitialWorkDirRequirement.

--no-expression-refactoring

  Don’t do any CWL expression refactoring.

### cwl-inputs-schema-gen

Generate JSON Schema from a CWL URI.

    usage: cwl-inputs-schema-gen [-h] [-o OUTPUT] cwl_url

cwl_url

  URL or Path to the CWL document

-h, --help

  show this help message and exit

-o <output>, --output <output>

  Output file. Default is stdout.

## Indices and tables

- Index

- Module Index

- Search Page