Launch a terminal and install by entering:
pip install gcp_python_client_functions- Create a GCP project by going to the Resource Manager page in the cloud console (cloud resources naming convention).
- Enable billing for the project you’ll work with by going to the Cloud Billing page and selecting your project on the top right corner (300 USD free credits are associated with new billing accounts + a big list of free tier products).
- Enable BigQuery API by going to APIs & Services page on the cloud console and looking for the BigQuery API.
Authenticating by… - (locally) using the Google Cloud SDK(installation needed). Launch a terminal enter:
gcloud auth login --update-adc- (elsewhere) downloading a service account JSON keyfile and point to it using an environment variable:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/keyfile.json"- or through Workflow Identity Provider (what we used to authenticate within GitHub Actions, see Cloud Advocate’s video and stackoverflow question for additional support).
from gcp_python_client_functions.clients import *
PROJECT_ID = 'dz-learning-d'
# BigQuery
bq_obj = BigQuery(PROJECT_ID)
# Cloud Storage
stg_obj = Storage(PROJECT_ID)