Skip to main content

get_configured_fsspec_kwargs

Retrieves fsspec keyword arguments for a specified storage protocol, or from the default storage configuration if no protocol is provided. It supports S3, GCS, and ABFS protocols, automatically configuring the appropriate filesystem if not already initialized.

def get_configured_fsspec_kwargs(
protocol: Optional[str] = None,
anonymous: bool = False
) - > Dict[str, Any]

Retrieves the fsspec keyword arguments for a specified storage protocol or the default configured storage. Callers use this to obtain configuration details necessary for interacting with various file systems (like S3, GCS, or Azure Blob Storage) using fsspec.

Parameters

NameTypeDescription
protocolOptional[str] = NoneThe storage protocol for which to retrieve fsspec keyword arguments (e.g., "s3", "gs", "abfs"). If not provided, the function attempts to return arguments for the globally configured storage.
anonymousbool = FalseA boolean flag indicating whether to retrieve fsspec keyword arguments for anonymous access. If true, credentials will not be included in the returned arguments.

Returns

TypeDescription
Dict[str, Any]A dictionary of keyword arguments suitable for fsspec, or an empty dictionary if no specific protocol is provided and no storage configuration is found.