# Tools and Workflows

Manage creation of tools and workflows for workflow tracking.

## Command-line tool

Represent a `CommandLineToolFactory` for tracking workflows.

class `renku.core.models.cwl.command_line_tool.``CommandLineToolFactory`(command_line, explicit_inputs=NOTHING, explicit_outputs=NOTHING, no_input_detection=False, no_output_detection=False, directory='.', working_dir='.', stdin=None, stderr=None, stdout=None, successCodes=NOTHING, annotations=None, messages=None, warnings=None)

  Command Line Tool Factory.

  Method generated by attrs for class CommandLineToolFactory.

  `add_indirect_inputs`()

    Read indirect inputs list and add them to explicit inputs.

  `add_indirect_outputs`()

    Read indirect outputs list and add them to explicit outputs.

  `find_explicit_inputs`()

    Yield explicit inputs and command line input bindings if any.

  `generate_process_run`(commit, path, name=None, description=None, keywords=None)

    Return an instance of `ProcessRun`.

  `guess_inputs`(*arguments)

    Yield command input parameters and command line bindings.

  `guess_outputs`(candidates)

    Yield detected output and changed command input parameter.

  `guess_type`(value, ignore_filenames=None)

    Return new value and CWL parameter type.

  `is_existing_path`(candidate, ignore=None)

    Return a path instance if it exists in current directory.

  `iter_input_files`(basedir)

    Yield tuples with input id and path.

  `split_command_and_args`()

    Return tuple with command and args from command line arguments.

  `validate_command_line`(attribute, value)

    Check the command line structure.

  `validate_path`(attribute, value)

    Path must exists.

  `watch`(client, no_output=False)

    Watch a Renku repository for changes to detect outputs.

`renku.core.models.cwl.command_line_tool.``add_indirect_parameter`(working_dir, name, value)

  Add a parameter to indirect parameters.

`renku.core.models.cwl.command_line_tool.``delete_indirect_files_list`(working_dir)

  Remove indirect inputs, outputs, and parameters list.

`renku.core.models.cwl.command_line_tool.``get_indirect_inputs_path`(client_path)

  Return path to file that contains indirect inputs list.

`renku.core.models.cwl.command_line_tool.``get_indirect_outputs_path`(client_path)

  Return path to file that contains indirect outputs list.

`renku.core.models.cwl.command_line_tool.``get_indirect_parameters_path`(client_path)

  Return path to file that contains indirect parameters list.

`renku.core.models.cwl.command_line_tool.``read_indirect_parameters`(working_dir)

  Read and return indirect parameters.

## Annotation

Represent an annotation for a workflow.

class `renku.core.models.cwl.annotation.``Annotation`(*, id, body=None, source=None)

  Represents a custom annotation for a research object.

class `renku.core.models.cwl.annotation.``AnnotationSchema`(*args, commit=None, client=None, **kwargs)

  Annotation schema.

  Create an instance.

  class `Meta`

    Meta class.

    `model`

      alias of `renku.core.models.cwl.annotation.Annotation`

## Parameter

Represent parameters from the Common Workflow Language.

class `renku.core.models.cwl.parameter.``CommandInputParameter`(id=None, streamable=None, type='string', description=None, default=None, inputBinding=None)

  An input parameter for a CommandLineTool.

  Method generated by attrs for class CommandInputParameter.

  classmethod `from_cwl`(data)

    Create instance from type definition.

  `to_argv`(**kwargs)

    Format command input parameter as shell argument.

class `renku.core.models.cwl.parameter.``CommandLineBinding`(position=None, prefix=None, separate=True, itemSeparator=None, valueFrom=None, shellQuote=True)

  Define the binding behavior when building the command line.

  Method generated by attrs for class CommandLineBinding.

  `to_argv`(default=None)

    Format command line binding as shell argument.

class `renku.core.models.cwl.parameter.``CommandOutputBinding`(glob=None)

  Define the binding behavior for outputs.

  Method generated by attrs for class CommandOutputBinding.

class `renku.core.models.cwl.parameter.``CommandOutputParameter`(id=None, streamable=None, type='string', description=None, format=None, outputBinding=None)

  Define an output parameter for a CommandLineTool.

  Method generated by attrs for class CommandOutputParameter.

class `renku.core.models.cwl.parameter.``InputParameter`(id=None, streamable=None, type='string', description=None, default=None, inputBinding=None)

  An input parameter.

  Method generated by attrs for class InputParameter.

class `renku.core.models.cwl.parameter.``OutputParameter`(id=None, streamable=None, type='string', description=None, format=None, outputBinding=None)

  An output parameter.

  Method generated by attrs for class OutputParameter.

class `renku.core.models.cwl.parameter.``Parameter`(streamable=None)

  Define an input or output parameter to a process.

  Method generated by attrs for class Parameter.

class `renku.core.models.cwl.parameter.``RunParameter`(name=None, value=None)

  Define a parameter for a Workflow that is not passed via command-line.

  Method generated by attrs for class RunParameter.

class `renku.core.models.cwl.parameter.``WorkflowOutputParameter`(id=None, streamable=None, type='string', description=None, format=None, outputBinding=None, outputSource=None)

  Define an output parameter for a Workflow.

  Method generated by attrs for class WorkflowOutputParameter.

`renku.core.models.cwl.parameter.``convert_default`(value)

  Convert a default value.

## Types

Represent the Common Workflow Language types.

class `renku.core.models.cwl.types.``Directory`(path=None, listing=NOTHING)

  Represent a directory.

  Method generated by attrs for class Directory.

class `renku.core.models.cwl.types.``Dirent`(entryname=None, entry=None, writable=False)

  Define a file or subdirectory.

  Method generated by attrs for class Dirent.

class `renku.core.models.cwl.types.``File`(path)

  Represent a file.

  Method generated by attrs for class File.

## Workflow

Represent workflows from the Common Workflow Language.

class `renku.core.models.cwl.workflow.``Workflow`(steps=NOTHING)

  Define a workflow representation.

  Method generated by attrs for class Workflow.

  `add_step`(**kwargs)

    Add a workflow step.

class `renku.core.models.cwl.workflow.``WorkflowStep`(run, id=NOTHING, in_=None, out=None)

  Define an executable element of a workflow.

  Method generated by attrs for class WorkflowStep.

`renku.core.models.cwl.workflow.``convert_run`(value)

  Convert value to CWLClass if dict is given.