inventory

function of dascore.core.inventory_loader source

inventory(
    source: dascore.core.inventory.Inventory | str | os.PathLike | None[Inventory, str, PathLike, None] = None,
)-> ‘Inventory’

Load or create a DASDAE inventory.

The one door every source goes through: what a source is decides how it is read, so nothing else has to guess.

Parameters

Parameter Description
source An existing Inventory (returned as is), a directory in the
authoring format, the path of a serialized document, the text of
one, or None for an empty inventory. A path is a path when it
exists; a string naming nothing is read as the document itself.

Examples

import dascore as dc
empty = dc.inventory()
assert dc.inventory(empty) is empty