Skip to main content
Version: 0.9.0

AzureSource

class AzureSource(
uri: str | List[str],
credentials: dict | AzureCredentials,
format: str | dict | FileFormat = None,
initial_last_modified: str | datetime = None,
)

Bases: Input

Categories: source

Class for managing the configuration of Azure-file-based data inputs.

Attributes: format (FileFormat): The format of the file. If not provided, it will be inferred from the file extension of the data. uri (str | List[str]): The URI of the files with format: 'az://path/to/files'. It can be a single URI or a list of URIs. credentials (AzureCredentials): The credentials required to access Azure. initial_last_modified (str | datetime.datetime): If provided, only the files modified after this date and time will be considered.

Methods: to_dict(): Converts the AzureSource object to a dictionary.

Initializes the AzureSource with the given URI and the credentials required to access Azure, and optionally a format and date and time after which the files were modified.

Parameters

parameter
uristr | List[str]

The URI of the files with format: 'az://path/to/files'. It can be a single URI or a list of URIs.

parameter
credentialsdict | AzureCredentials

The credentials required to access Azure. Can be a dictionary or a AzureCredentials object.

parameter
formatstr | dict | FileFormat, optional

The format of the file. If not provided, it will be inferred from the file extension of the data. Can be either a string with the format, a FileFormat object or a dictionary with the format as the 'type' key and any additional format-specific information. Currently supported formats are 'csv', 'parquet', 'ndjson', 'jsonl' and 'log'.

parameter
initial_last_modifiedstr | datetime.datetime, optional

If provided, only the files modified after this date and time will be considered. The date and time can be provided as a string in ISO 8601 format or as a datetime object. If no timezone is provided, UTC will be assumed.

Raises

InputConfigurationError FormatConfigurationError

Properties

property
credentialsAzureCredentials

The credentials required to access Azure.

property
formatFileFormat

The format of the file. If not provided, it will be inferred from the file extension of the data.

property
initial_last_modifiedstr

The date and time after which the files were modified.

property
uristr | List[str]

The URI of the files with format: 'az://path/to/files'.

SupportedFormats
class SupportedFormats(*args, **kwds)

Bases: Enum

Enum for the supported formats for the AzureSource.

attribute
csv

attribute
ndjson

attribute
log

attribute
parquet

Methods

to_dict
def to_dict() -> dict

Converts the AzureSource object to a dictionary with all the relevant information.

Returns:

dict: A dictionary with the relevant information of the AzureSource object.