DirectoryResourceMapping

class asdf_standard.resource.DirectoryResourceMapping(root, uri_prefix, recursive=False, filename_pattern='*.yaml', stem_filename=True)[source]

Bases: Mapping

Resource mapping that reads resource content from a directory or directory tree.

Parameters
rootstr or importlib.abc.Traversable

Root directory (or directory-like Traversable) of the resource files. str will be interpreted as a filesystem path.

uri_prefixstr

Prefix used to construct URIs from file paths. The prefix will be prepended to paths relative to the root directory.

recursivebool, optional

If True, recurse into subdirectories. Defaults to False.

filename_patternstr, optional

Glob pattern that identifies relevant filenames. Defaults to "*.yaml".

stem_filenamebool, optional

If True, remove the filename’s extension when constructing its URI.