google-big-queryHow do I set up a Google BigQuery access key?
- To set up a Google BigQuery access key, you will need to create a service account.
- Go to the Google Cloud Platform Console, select the project you want to use, and open the IAM & Admin page.
- Click the + CREATE SERVICE ACCOUNT button at the top of the page.
- Enter a name and description for the service account, and select Furnish a new private key.
- Select the JSON key type.
- Click Create. A JSON key file will be downloaded to your computer.
- You can use the credentials in the JSON key file to authenticate to BigQuery.
Example code block:
from google.cloud import bigquery
# Construct a BigQuery client object.
client = bigquery.Client.from_service_account_json('/path/to/key.json')
Code explanation
from google.cloud import bigquery
: imports the BigQuery client libraryclient = bigquery.Client.from_service_account_json('/path/to/key.json')
: creates a BigQuery client object from the credentials in the JSON key file
Helpful links
More of Google Big Query
- How can I use Google Big Query to count the number of zeros in a given dataset?
- How can I use Google BigQuery to retrieve data from a specific year?
- What are the advantages and disadvantages of using Google BigQuery?
- What is Google Big Query?
- How can I use Google Big Query with Python?
- How do I use a Google Big Query refresh token?
- How can I learn to use Google Big Query?
- How do I use an IF statement in Google BigQuery?
- How do I use the Google BigQuery API with Java?
- How can I use Google BigQuery to query a JSON string?
See more codes...