loadyaml(filename=None, folder=None, string=None, fromfile=True, safe=False, loader=None)[source]#

Convenience function for reading a YAML file (or string).

  • filename (str) – the file to load, or the YAML object if using positional arguments

  • folder (str) – folder if not part of the filename

  • string (str) – if not loading from a file, a string representation of the YAML

  • fromfile (bool) – whether or not to load from file

  • safe (bool) – whether to use the safe loader

  • loader (Loader) – custom YAML loader (takes precedence over safe)


the YAML object

Return type:

output (dict)


yaml = sc.loadyaml('my-file.yaml')
yaml = sc.loadyaml(string='{"a":null, "b":[1,2,3]}')