Storage
Storage prototype
- class qarnot.storage.Storage[source]
Bases:
object
Common architecture for storage providers
- get_all_files(output_dir, progress=None)[source]
Get all files from the storage.
- Parameters:
- Raises:
MissingBucketException – the bucket is not on the server
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
Warning
Will override output_dir content.
- list_files()[source]
List files on the storage.
- … note:
File object returned must have a key property.
- Returns:
List of the files on the storage.
- get_file(remote, local=None, progress=None)[source]
Get a file from the storage. Create needed subfolders.
- Parameters:
- Return type:
- Returns:
The name of the output file.
- Raises:
ValueError – no such file
- add_directory(local, remote)[source]
Add a directory to the storage. Does not follow symlinks. File hierarchy is preserved.
- add_file(local_or_file, remote)[source]
Add a local file or a Python File on the storage.
Note
You can also use object[remote] = local
- delete_file(remote)[source]
Delete a file from the storage.
- Parameters:
remote (str) – the name of the remote file