dump_document
dump_document(
document: Mapping ,
file_format: Literal[‘json’, ‘yaml’] ,
)-> ‘str’
Return the text a mapping is written as, in the format named.
Either spelling keeps the order the document states rather than sorting: a document says what it holds, its own order reads better, and a set written twice reads the same both times.