Class swarmauri_storage_file.file_storage_adapter.FileStorageAdapter
swarmauri_storage_file.file_storage_adapter.FileStorageAdapter
FileStorageAdapter(output_dir, *, prefix='', **kwargs)
Bases: StorageAdapterBase
Write and read artefacts on the local disk.
Source code in swarmauri_storage_file/file_storage_adapter.py
23 24 25 26 27 | |
root_uri
property
root_uri
Return the workspace root as a file:// URI.
upload
upload(key, data)
Copy data to ${root_dir}/${key} atomically and return the artifact URI.
Source code in swarmauri_storage_file/file_storage_adapter.py
42 43 44 45 46 47 48 49 50 51 52 53 | |
download
download(key)
Return a :class:BytesIO with the contents of ${root_dir}/${key}.
Source code in swarmauri_storage_file/file_storage_adapter.py
56 57 58 59 60 61 62 63 64 | |
upload_dir
upload_dir(src, *, prefix='')
Recursively upload files from src under prefix.
Source code in swarmauri_storage_file/file_storage_adapter.py
67 68 69 70 71 72 73 74 75 | |
iter_prefix
iter_prefix(prefix)
Yield stored keys beginning with prefix.
Source code in swarmauri_storage_file/file_storage_adapter.py
78 79 80 81 82 83 84 85 86 | |
download_dir
download_dir(prefix, dest_dir)
Copy all files under prefix into dest_dir.
Source code in swarmauri_storage_file/file_storage_adapter.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
from_uri
classmethod
from_uri(uri)
Instantiate the adapter from a file:// URI.
Source code in swarmauri_storage_file/file_storage_adapter.py
102 103 104 105 106 | |