Class - AzureBlobDataSource#

class openfl.federated.data.sources.azure_blob_data_source.AzureBlobDataSource(name, connection_string, container_name, folder_prefix='', hash_func=<built-in function openssl_sha384>)[source]#

Bases: DataSource

Class for Azure Blob data

Parameters:
  • name (str)

  • connection_string (str)

  • container_name (str)

  • hash_func (Callable[[...], hashlib._Hash])

__init__(name, connection_string, container_name, folder_prefix='', hash_func=<built-in function openssl_sha384>)[source]#

Initialize a DataSource.

Parameters:
  • type (DataSourceType) – The storage type of the data source.

  • name (str) – The name of the data source.

  • connection_string (str)

  • container_name (str)

  • hash_func (Callable[[...], hashlib._Hash])

Methods

__init__(name, connection_string, container_name)

Initialize a DataSource.

compute_file_hash(blob_path)

Compute the hash of a blob's binary content.

enumerate_files()

List all blobs in the container (full recursive listing)

from_dict(ds_dict)

Create a DataSource from a dictionary.

is_valid_hash_function(func)

read_blob(blob_path)

Read blob content as binary data.

to_dict()

Convert the object to a dictionary using the serialization rules.

compute_file_hash(blob_path)[source]#

Compute the hash of a blob’s binary content.

Parameters:

blob_path (str)

enumerate_files()[source]#

List all blobs in the container (full recursive listing)

classmethod from_dict(ds_dict)[source]#

Create a DataSource from a dictionary.

Parameters:

ds_dict (dict) – The dictionary to convert.

Returns:

The created DataSource.

Return type:

DataSource

read_blob(blob_path)[source]#

Read blob content as binary data.

Parameters:

blob_path (str)

to_dict()[source]#

Convert the object to a dictionary using the serialization rules.

Return type:

Dict[str, Any]