in src/gcf/main.py [0:0]
def read_blob(bucket_name: str, file_name: str) -> Optional[str]:
"""Read an object from the bucket.
Args:
bucket_name: bucket name containingh image
file_name: path+file name for the image
Returns:
Object data object.
"""
storage_client = storage.Client()
bucket = storage_client.bucket(bucket_name)
blob = bucket.blob(file_name)
try:
with blob.open("rb") as fp:
content = fp.read()
except Exception:
return None
return content