prefect_azure.blob_storage
Integrations for interacting with Azure Blob Storage
Functions
blob_storage_download
bytes representation of the downloaded blob.
Example:
Download a file from a Blob Storage container
blob_storage_upload
True, an existing blob with the same name will be overwritten.
Defaults to False and an error will be thrown if the blob already exists.
Returns:
The blob name of the uploaded object
Example:
Read and upload a file to a Blob Storage container
blob_storage_list
ContainerClient.list_blobs()
Returns:
A list of dicts containing metadata about the blob.
Example:
Classes
AzureBlobStorageContainer
Represents a container in Azure Blob Storage.
This class provides methods for downloading and uploading files and folders
to and from the Azure Blob Storage container.
Attributes:
container_name: The name of the Azure Blob Storage container.credentials: The credentials to use for authentication with Azure.base_folder: A base path to a folder within the container to use for reading and writing objects.
download_folder_to_path
from_folder: The folder path in the container to download.to_folder: The local path to download the folder to.**download_kwargs: Additional keyword arguments passed intoBlobClient.download_blob.
- The local path where the folder was downloaded.
download_object_to_file_object
from_path: The path of the object to download within the container.to_file_object: The file object to download the object to.**download_kwargs: Additional keyword arguments for the download operation.
- The file object that the object was downloaded to.
download_object_to_path
from_path: The path of the object in the container.to_path: The path where the object will be downloaded to.**download_kwargs: Additional keyword arguments for the download operation.
- The path where the object was downloaded to.
get_directory
from_path: The path of the directory in the blob storage.local_path: The local path where the directory will be downloaded.
list_blobs
- A list of the blobs within your container.
put_directory
local_path: The local path of the directory to upload. Defaults to current directory.to_path: The destination path in the blob storage. Defaults to root directory.ignore_file: The path to a file containing patterns to ignore during upload.
read_path
path: The path of the file to read.
- The contents of the file as bytes.
upload_from_file_object
from_file_object: The file object to upload.to_path: The path in the blob storage container to upload the object to.**upload_kwargs: Additional keyword arguments to pass to the upload_blob method.
- The path where the object was uploaded to.
upload_from_folder
from_folder: The path to the local folder containing the files to upload.to_folder: The destination folder in the Azure Blob Storage container.**upload_kwargs: Additional keyword arguments to pass to theupload_blobmethod.
- The full path of the destination folder in the container.
upload_from_path
from_path: The local path of the object to upload.to_path: The destination path in the blob storage container.**upload_kwargs: Additional keyword arguments to pass to theupload_blobmethod.
- The destination path in the blob storage container.
write_path
path: The path where the content will be written.content: The content to be written.