I've been new working Google Cloud Platform and am looking to read files from a bucket, do some transformation, then eventually save transformed data back into Cloud Storage. As of now, I'm having trouble reading that data and seeing even the file names. Could I get some insight on how to best read and transform data from a bucket?
Here is my code:
from google.cloud import storage
from google.cloud.storage import Blob
bucket_name = 'test_bucket'
file_name = '*.txt'
client = storage.Client()
bucket = client.get_bucket(bucket_name)
for f in bucket:
print(f)
TypeError: 'Bucket' object is not iterable
blob = bucket.get_blob(file_name)
print(blob)
None
print(blob.download_as_string())