This page describes storage examples using the StorageManager class. The storage examples include:
- Downloading a file - Get an object from storage.
- Uploading a file - Upload an object.
- Setting cache limits - Set the maximum number of objects.
StorageManager supports http(s), S3, Google Cloud Storage, Azure, and file system folders.
To download a ZIP file from storage to the
global cache context, call the StorageManager.get_local_copy
method, and specify the destination location as the
Zip and tar.gz files will be automatically extracted to cache. This can be controlled with the
To download a file to a specific context in cache, specify the name of the context as the
To download a non-compressed file, set the
extract_archive argument to
To upload a file to storage, call the StorageManager.upload_file
method. Specify the full path of the local file as the
local_file argument, and the remote URL as the
To set a limit on the number of files cached, call the StorageManager.set_cache_file_limit
method and specify the
cache_file_limit argument as the maximum number of files. This does not limit the cache size,
only the number of files.