Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyarrow.parquet as pq
- from azure.storage.blob import BlobServiceClient
- blob_service_client = BlobServiceClient.from_connection_string("<Azure Blob Storage Connection String>")
- container_client = blob_service_client.get_container_client("export")
- # List blobs
- blobs_list = container_client.list_blobs()
- for blob in blobs_list:
- print(blob.name + '\n')
- # Download single blob
- blob_client = container_client.get_blob_client("<Path to particular file>")
- with open("sample.parquet", "wb") as f:
- download_stream = blob_client.download_blob()
- f.write(download_stream.readall())
- # Display sample
- sample = pq.read_table("sample.parquet")
- print(sample.to_pandas())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement