documents

module of dascore.utils source

Reading and writing the small YAML-or-JSON documents DASCore stores.

An inventory object, an annotation set’s attributes and a saved workflow are all one mapping written as either spelling, so they are read the same way: the caller decides which parser its own naming rules call for, and this turns whatever comes back into a mapping or says why it could not.

Functions

Name Description
dump_document Return the text a mapping is written as, in the format named.
parse_document Return whatever a document’s text holds, naming its source if it cannot.
read_document Return the mapping a document file holds.
write_document Write a mapping to a file, in the format named, and return the path.
write_text_document Write a document’s text to a file and return the path.