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)
- 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(_warn=True)#
Return source of data.
- property root_directory: Path#
Root directory containing data.
Call
get_root_directory()and, if necessary, joins individuals folders into a single path.