eradiate.data.SafeDirectoryDataStore
eradiate.data.SafeDirectoryDataStore#
- class eradiate.data.SafeDirectoryDataStore(path, registry_fname='registry.txt')[source]#
Bases:
eradiate.data._core.DataStore
Serve files stored in a directory. This data store will only serve files listed in its registry.
- Parameters
- Fields
- registry_fetch()[source]#
Get the absolute path to the registry file. If no file exists, one will be created based on the rules contained defined in
self.path / "registry_rules.yml"
.
- registry_files(filter=None)[source]#
Get a list of registered files.
- Parameters
filter (
callable()
, optional) – A filter function taking a file path as a single string argument and returning a boolean. Filenames for which the filter returnsTrue
will be returned.- Returns
- registry_make()[source]#
Generate a registry file from the contents of the
self.path
directory, according to inclusion and exclusion rules defined in theself.path / "registry_rules.yml"
file. The generated registry is written toself.path / self.registry_fname
.
- property registry_path#
Path to the registry file.
- Type
Path