Skip to main content

dump_yaml

dump_yaml(obj, path: Union[str, Path] = None, **kwargs) -> None

  • Description

    Write an object to a YAML file.

  • Parameters

    • obj (Any): The object to write.
    • path (Union[str, Path]): The path to the YAML file. Defaults to None, indicating writing to tmp.yaml in the current directory.
    • **kwargs: Additional parameters for yaml.dump.
  • Example

    import docsaidkit as D

    data = {'key': 'value'}
    D.dump_yaml(data)