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
from google.cloud import storage | |
# Setup variables | |
PROJECT_ID = 'project-id' # Ver nota relacionada GCP Setup - Getting Project ID | |
BUCKET = "bucket-name" | |
REGION = 'us-central1' | |
storage_client = storage.Client(project = PROJECT_ID) | |
if not storage_client.lookup_bucket(BUCKET): |
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
# Version 1 | |
project_id = %system gcloud config get-value core/project | |
project_id = project_id[0] | |
# Version 2 | |
project_id = ! gcloud config list --format 'value(core.project)' 2>/dev/null | |
PROJECT_ID = project_id[0] | |
# Version 3 |