(
    path: FilePath,
    data: YAMLInput,
    indent_mapping: int = 2,
    indent_sequence: int = 4,
    indent_offset: int = 2,
    sort_keys: bool = False,
)
Create a .json file and dump contents or write to standard
    output.

    location (FilePath): The file path. "-" for writing to stdout.
    data (YAMLInput): The JSON-serializable data to output.
    indent_mapping (int): Mapping indentation.
    indent_sequence (int): Sequence indentation.
    indent_offset (int): Indentation offset.
    sort_keys (bool): Sort dictionary keys.
Create a .json file and dump contents or write to standard
    output.
Create a . json file and dump contents or write to standard output .
def write_yaml(
    path: FilePath,
    data: YAMLInput,
    indent_mapping: int = 2,
    indent_sequence: int = 4,
    indent_offset: int = 2,
    sort_keys: bool = False,
) -> None:
    """Create a .json file and dump contents or write to standard
    output.

    location (FilePath): The file path. "-" for writing to stdout.
    data (YAMLInput): The JSON-serializable data to output.
    indent_mapping (int): Mapping indentation.
    indent_sequence (int): Sequence indentation.
    indent_offset (int): Indentation offset.
    sort_keys (bool): Sort dictionary keys.
    """
    yaml_data = yaml_dumps(
        data,
        indent_mapping=indent_mapping,
        indent_sequence=indent_sequence,
        indent_offset=indent_offset,
        sort_keys=sort_keys,
    )
    if path == "-":  # writing to stdout
        print(yaml_data)
    else:
        file_path = force_path(path, require_exists=False)
        with file_path.open("w", encoding="utf8") as f:
            f.write(yaml_data)
def write_yaml ( path : FilePath , data : YAMLInput , indent_mapping : int = 2 , indent_sequence : int = 4 , indent_offset : int = 2 , sort_keys : bool = False , ) -> None : yaml_data = yaml_dumps ( data , indent_mapping = indent_mapping , indent_sequence = indent_sequence , indent_offset = indent_offset , sort_keys = sort_keys , ) if path == "-" : # writing to stdout print ( yaml_data ) else : file_path = force_path ( path , require_exists = False ) with file_path . open ( "w" , encoding = "utf8" ) as f : f . write ( yaml_data )