uwtools.api.rocoto
API access to uwtools Rocoto support.
- uwtools.api.rocoto.realize(config: Optional[Union[YAMLConfig, Path, str]], output_file: Optional[Union[str, Path]] = None, stdin_ok: bool = False) bool
Realize the Rocoto workflow defined in the given YAML as XML.
If no input file is specified,
stdinis read. AYAMLConfigobject may also be provided as input. If no output file is specified,stdoutis written to. Both the input config and output Rocoto XML will be validated against appropriate schcemas.- Parameters
config – Path to YAML input file (
Noneor unspecified => readstdin), orYAMLConfigobjectoutput_file – Path to write rendered XML file (
Noneor unspecified => write tostdout)stdin_ok – OK to read from
stdin?
- Returns
True
- uwtools.api.rocoto.validate(xml_file: Optional[Union[str, Path]] = None, stdin_ok: bool = False) bool
Validate purported Rocoto XML file against its schema.
- Parameters
xml_file – Path to XML file (
Noneor unspecified => readstdin)stdin_ok – OK to read from
stdin?
- Returns
Trueif the XML conforms to the schema,Falseotherwise