If you want to work with Big Query you need to authenticate to the Google Cloud. BigQuery is a Google Cloud data warehouse.
You do this by running this command from the command line. The shell will open the browser then ask you to login to Google. It will then save credentials on your laptop. When you create the
Session object with the API Google will know where to read that session from. It will also use those credentials when you use the Google cloud command-line tool
gcloud auth application-default login
Here is a Python example showing how to use those Google credentials.
Install the SDK and Python package:
brew install google-cloud-sdk
pip install google-cloud-storage
In this Python example we give it the name of project. Or you can put
from google.cloud import storage
storage_client = storage.Client("ecstatic-doodad-203713")
buckets = storage_client.list_buckets()
for bucket in buckets:
Here is an example using the Google Cloud Command Line Utility. It lists Storage buckets in a project:
gsutil ls -p ecstatic-doodad-203713
Updated 2 months ago