Commit 840143de authored by Arnaud Jaen's avatar Arnaud Jaen
Browse files

Add a method to download blob locally

parent 46812582
......@@ -149,6 +149,21 @@ class AzureBlobClient:
"""
self.blob_container_client(container_name=container_name).delete_blob(blob=blob_name)
def download_blob(self, container_name: str, blob_name: str, local_filename: str):
"""Function to download a blob within a container
:param container_name: Name of the container
:type container_name: str
:param blob_name: Name of the blob to download
:type blob_name: str
:param local_filename: Name of the local downloaded file
:type local_filename: str
"""
with open(local_filename, "wb") as my_blob:
download_stream = self.blob_container_client(container_name=container_name).download_blob(blob=blob_name)
my_blob.write(download_stream.readall())
def get_blob_sas_url(self, container_name, blob_name, time_to_expiry=1):
"""
Get the URL of a blob, with the necessary read access
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment