Skip to main content

dump_yaml

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

  • Description: Writes an object to a YAML file.

  • Parameters:

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

    import capybara as cb

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