from google.cloud import bigquery # Construct a BigQuery client object. client = bigquery.Client() datasets = list(client.list_datasets()) # Make an API request. project = client.project if datasets: print("Datasets in project {}:".format(project)) for dataset in datasets: print("\t{}".format(dataset.dataset_id)) else: print("{} project does not contain any datasets.".format(project))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter