MultiFileSource#

class MultiFileSource(params=None, **kwargs)#

Bases: SourceAbstract[str]

Abstract class for source consisting of multiple files.

It is easier to deal with multiple files when separating a root directory, and the files therein. root_directory() deals with that.

Also defines an autocached property datafiles() that will be returned upon asking the source. If they are many files, caching this can make sense.

Parameters:

params (t.Any | None)

property datafiles: list[str]#

List of source files.

Not implemented:

implement in plugin subclass.

get_root_directory()#

Return the directory containing all datafiles.

Can return a path, or an iterable of directories that will automatically be joined into a valid path.

Not implemented:

implement in your DataManager subclass.

Return type:

str | PathLike | list[str | PathLike]

get_source(_warn=True)#

Return source of data.

Not Implemented:

Implement in Module subclass

Parameters:

_warn (bool)

Return type:

list[str]

property root_directory: Path#

Root directory containing data.

Call get_root_directory() and, if necessary, joins individuals folders into a single path.