Azure Blob - Read using Python

前端 未结 5 781
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 03:18

Can someone tell me if it is possible to read a csv file directly from Azure blob storage as a stream and process it using Python? I know it can be done using C#.Net (shown

5条回答
  •  失恋的感觉
    2020-12-14 03:54

    Yes, it is certainly possible to do so. Check out Azure Storage SDK for Python

    from azure.storage.blob import BlockBlobService
    
    block_blob_service = BlockBlobService(account_name='myaccount', account_key='mykey')
    
    block_blob_service.get_blob_to_path('mycontainer', 'myblockblob', 'out-sunset.png')
    

    You can read the complete SDK documentation here: http://azure-storage.readthedocs.io.

提交回复
热议问题