loadyaml#
- loadyaml(filename=None, folder=None, string=None, fromfile=True, safe=False, loader=None)[source]#
Convenience function for reading a YAML file (or string).
- Parameters:
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
)
- Returns:
the YAML object
- Return type:
output (dict)
Examples:
yaml = sc.loadyaml('my-file.yaml') yaml = sc.loadyaml(string='{"a":null, "b":[1,2,3]}')