<jupyter_start><jupyter_text>CamHD Video File to Azure Blob with Dask  Upload file from URL to Microsoft Azure Blob Storage<jupyter_code># # import modules
import azure.storage.blob as ASB
import azure.storage.common
import yaml
# load Azure storage account credentials
with open('/home/jovyan/.azure_credentials_ooitest.yaml', 'r') as f:
    credentials = yaml.load(f)
azure_storage_account_name = credentials['azure_storage_account_name']
azure_storage_account_key = credentials['azure_storage_account_key']
block_blob_service = ASB.BlockBlobService(azure_storage_account_name, azure_storage_account_key)
container_name ='movtest'
block_blob_service.create_container(container_name)
# define function to copy from remote url to blob storage
def run_sample():
       block_blob_service.copy_blob(container_name,'rawdata','https://rawdata.oceanobservatories.org/files/RS03ASHS/PN03B/06-CAMHDA301/2019/07/09/CAMHDA301-20190709T031500.mov')


 # run function
if __name__ == '__main__':
     run_sample()<jupyter_output><empty_output><jupyter_text>Check size of containters & blobs to see if it worked<jupyter_code>containers = block_blob_service.list_containers()
for c in containers:
        contName = c.name
        generator = block_blob_service.list_blobs(contName)
        contSize = 0
        contNum = 0
        for blob in generator: 
            contSize += blob.properties.content_length
            contNum += 1
        print(contName + " : " + str(contSize/1000000) + " MB" + " in " + str(contNum) + " blobs")<jupyter_output><empty_output><jupyter_text>Clean up your space before you go home  clean up blobs<jupyter_code>blob_list = block_blob_service.list_blobs(container_name)
for blob in blob_list: 
    blob_name = blob.name
    print(blob_name)
# # delete all blobs in container
# blob = block_blob_service.list_blobs(container_name)
# #for a in blob:
#        #blob_service.delete_blob(container_name = container_name, blob_name = a.name)<jupyter_output><empty_output><jupyter_text>clean up containers<jupyter_code># # #set container to delete
# container_name = 'mp4test'
# # Clean up resources. This includes the container and the temp files.
block_blob_service.delete_container(container_name)
# # os.remove(full_path_to_file)
# # os.remove(full_path_to_file2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09134199134199134, 'fraction_numerical': 0.019913419913419914, 'mean_word_length': 5.383977900552487, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '403777', 'license': 'MIT', 'n_tokens_mistral': 785, 'n_tokens_neox': 746, 'n_words': 159, 'path': 'notebooks/azure/from_url_to_azure.ipynb', 'repo_name': 'daxsoule/camhd_floc_model', 'size': '2310'}