modos.io#

Attributes#

Classes#

Functions#

get_loader(path)

Get a loader based on the file extension using regex.

parse_instance(path, target_class)

Load a model of target_class from a file.

parse_attributes(path)

Load model specification from file into a list of dictionaries. Model types must be specified as @type

parse_multiple_instances(path)

Load one or more model from file. Model types must be specified as @type

extract_metadata(instance, base_path)

Extract metadata from files associated to a model instance

Module Contents#

modos.io.ext2loader[source]#
modos.io.get_loader(path)[source]#

Get a loader based on the file extension using regex.

Parameters:

path (pathlib.Path)

modos.io.parse_instance(path, target_class)[source]#

Load a model of target_class from a file.

Parameters:

path (pathlib.Path)

modos.io.parse_attributes(path)[source]#

Load model specification from file into a list of dictionaries. Model types must be specified as @type

Parameters:

path (pathlib.Path)

Return type:

List[dict]

modos.io.parse_multiple_instances(path)[source]#

Load one or more model from file. Model types must be specified as @type

Parameters:

path (pathlib.Path)

Return type:

List

class modos.io.ExtractedMetadata[source]#
elements: list[modos_schema.datamodel.NamedThing][source]#
arrays: dict[str, zarr.Array] | None = None[source]#
modos.io.extract_metadata(instance, base_path)[source]#

Extract metadata from files associated to a model instance

Parameters:

base_path (pathlib.Path)

Return type:

ExtractedMetadata