Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyarrow as pa
- 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>")
- download_stream = blob_client.download_blob()
- reader = pa.BufferReader(download_stream.readall())
- sample = pq.read_table(reader)
- print(sample.to_pandas())
RAW Paste Data