File size: 461 Bytes
3322c73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from google.cloud import storage
from google.oauth2 import service_account

creds = service_account.Credentials.from_service_account_file("credentials.json")
client = storage.Client(credentials=creds)

def create_bucket(bucket_name):
    try:
        bucket = client.create_bucket(bucket_name)
        print(f"Bucket {bucket.name} created")
        return True
    except Exception as e:
        print(e)
        return False

create_bucket("bucket-embeddings")