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 (Any | None)
kwargs (Any)
- property datafiles: list[str]#
List of source files.
- Not implemented:
implement in a module 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.
- get_source(relative=False, _warn=True)#
Return list of filenames.
- property root_directory: Path#
Root directory containing data.
Call
get_root_directory()and, if necessary, joins individuals folders into a single path.