Wednesday, May 15, 2019

DataEng: GCS: retrieving information from Bucket objects with gcs command and python API

Retrieving information from the bucket can be achieved with either through gcs command line or google lab python API.

import google.datalab.storage as storage

#Create an object for the specific bucket
bucket_object = storage.Bucket('datalab-project-1-239921')

#iterate through the objects and print them
for obj in bucket_object.objects():
    print(obj.key)


No comments:

Post a Comment

Pandas: SQL Like pandas operations

Pandas's SQL Like operations such as WHERE clause. = != >= str.contains() & | .isin() .isnull() .notnull() ....