Skip to content

StorageProxyLocal«

StorageProxyLocal (StorageProxy) «

Local storage proxy used to communicate with local filesystem to manage data.

Attributes:

Name Type Description
root_dir str

Root directory to read and write objects to.

client StorageProxy

Client communicating with storage, ie. Path.

__init__(self, root_dir, client, config={}) special «

Parameters:

Name Type Description Default
root_dir str

Root directory to read and write objects to.

required
client StorageProxy

Client communicating with storage, ie. Path.

required
config dict

Dict object defining configuration for proxy.

{}

delete_directory(self, directory) «

Remove directory from storage.

Parameters:

Name Type Description Default
directory str

Name of file, ie. image.jpeg

required

Returns:

Type Description
None

Raises StorageProxyException if error occured.

delete_file(self, filename) «

Remove file from storage.

Parameters:

Name Type Description Default
filename str

Name of file, ie. image.jpeg

required

Returns:

Type Description
None

Raises StorageProxyException if error occured.

get_bytes(self, filename) «

Fetch bytes data from storage.

Parameters:

Name Type Description Default
filename str

Name of file, ie. image.jpeg

required

Returns:

Type Description
bytes

bytes data requested, raises StorageProxyException if not found.

get_json(self, filename) «

Fetch JSON data from storage.

Parameters:

Name Type Description Default
filename str

Name of file, ie. index.json

required

Returns:

Type Description
dict

JSON data requested, raises StorageProxyException if not found.

list_files(self) «

List all files in directory.

Returns:

Type Description
list

List of all paths in directory.

save_bytes(self, bytes, filename) «

Save bytes data to storage.

Parameters:

Name Type Description Default
body bytes

Filename to be used to save object, ie. image.jpeg

required
filename str

Name of file, ie. index.json

required

Returns:

Type Description
None

Raises StorageProxyException if error occured.

save_json(self, body, filename) «

Save JSON data to storage.

Parameters:

Name Type Description Default
body dict

Filename to be used to save object, ie. index.json

required
filename str

Name of file, ie. index.json

required

Returns:

Type Description
None

Raises StorageProxyException if error occured.

Back to top