cwl_utils.inputs_schema_gen
Generate JSON Schema from CWL inputs object.
Attributes
Classes
Generate a JSON schema property from a CWL input parameter. |
Functions
|
Given an input parameter, return if it is required. |
Given an input parameter, generate a JSON schema property. |
|
|
Given a schema, generate a JSON schema definition. |
|
cwl_obj: A CWL Object. |
|
Recursively collect all dependencies for a property. |
|
Slim down the schema to only the definitions that are used by the properties. |
Build the argument parser. |
|
|
Parse the command line arguments. |
|
Console entry point. |
|
Conform to uri format. |
|
Run the main program. |
Module Contents
- cwl_utils.inputs_schema_gen.defaultStreamHandler
- cwl_utils.inputs_schema_gen.PRIMITIVE_TYPES_MAPPING
- cwl_utils.inputs_schema_gen.JSON_TEMPLATE_PATH
- cwl_utils.inputs_schema_gen.InputType
- class cwl_utils.inputs_schema_gen.JSONSchemaProperty(name, type_, description='', required=False)
Generate a JSON schema property from a CWL input parameter.
- Parameters:
- description = ''
- required = False
- type_dict
- generate_type_dict()
Generate the type dict for a property from a CWL input parameter type.
- generate_type_dict_from_type(type_item)
Generate the type dict for a property from a CWL input parameter type.
We call this function for each type in the type_ list In the case there are multiple types, each dict is added to the oneOf list
- generate_type_dict_from_type_list(type_)
Given a list of types, generate a JSON schema property dict wrapped in oneOf list.
- cwl_utils.inputs_schema_gen.get_is_required_from_input_parameter(input_parameter)
Given an input parameter, return if it is required.
- Parameters:
input_parameter (cwl_utils.parser.WorkflowInputParameter)
- Return type:
- cwl_utils.inputs_schema_gen.generate_json_schema_property_from_input_parameter(input_parameter)
Given an input parameter, generate a JSON schema property.
- Parameters:
input_parameter (cwl_utils.parser.WorkflowInputParameter)
- Returns:
- Return type:
- cwl_utils.inputs_schema_gen.generate_definition_from_schema(schema)
Given a schema, generate a JSON schema definition.
- cwl_utils.inputs_schema_gen.cwl_to_jsonschema(cwl_obj)
cwl_obj: A CWL Object.
- Returns:
A JSONSchema object.
- Example:
cwl_obj = load_document_by_uri(<CWL_URL>) jsonschema = cwl_to_jsonschema(cwl_inputs)
- Parameters:
cwl_obj (Union[cwl_utils.parser.Workflow, cwl_utils.parser.CommandLineTool])
- Return type:
Any
- cwl_utils.inputs_schema_gen.get_property_dependencies(property_dict, input_json_schema, existing_property_dependencies=None)
Recursively collect all dependencies for a property.
- cwl_utils.inputs_schema_gen.slim_definitions(input_json_schema)
Slim down the schema to only the definitions that are used by the properties.
Traverse the properties and return all definitions that are used. Remove all other definitions.
- cwl_utils.inputs_schema_gen.arg_parser()
Build the argument parser.
- Return type:
- cwl_utils.inputs_schema_gen.parse_args(args)
Parse the command line arguments.
- Parameters:
- Return type:
- cwl_utils.inputs_schema_gen.main()
Console entry point.
- Return type:
None
- cwl_utils.inputs_schema_gen.get_cwl_url(url)
Conform to uri format.
If no scheme, then assert is a local file path and exists if scheme is file, then assert is a local file path and exists If scheme is not file, then assert is a valid Web URL Return either the url or the local path as a uri.
- cwl_utils.inputs_schema_gen.run(args)
Run the main program.
- Parameters:
args (argparse.Namespace)
- Return type: