Created
February 3, 2022 12:57
-
-
Save jsj14/430d35731977eb49a06e7e6e120e415b to your computer and use it in GitHub Desktop.
upload data from memory to gcs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_blob(bucket_name, source_data, destination_blob_name): | |
"""Uploads a file to the bucket.""" | |
print('function upload_blob called') | |
bucket = storage_client.get_bucket(bucket_name) | |
blob = bucket.blob(destination_blob_name) | |
blob.upload_from_string(source_data) | |
print('File {} uploaded to {}.'.format(destination_blob_name, bucket_name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment