Azure Blob-使用Python读取 [英] Azure Blob - Read using Python

查看:158
本文介绍了Azure Blob-使用Python读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我是否可以直接从Azure blob存储中读取csv文件作为流并使用Python处理它吗?我知道可以使用C#.Net(如下所示)完成此操作,但想知道Python中的等效库可以执行此操作.

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 below) but wanted to know the equivalent library in Python to do this.

CloudBlobClient client = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = client.GetContainerReference("outfiles");
CloudBlob blob = container.GetBlobReference("Test.csv");*

推荐答案

是的,当然可以.查看 Azure Storage SDK for Python

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')

您可以在此处阅读完整的SDK文档: http://azure-storage.readthedocs.io

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

这篇关于Azure Blob-使用Python读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆