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 do I set up a Google Big Query zone?
- How do I use Google Big Query to merge data?
- How can I create a histogram in Google BigQuery?
- How can I use Google Big Query to count the number of zeros in a given dataset?
- How can I use Google BigQuery to answer specific questions?
- How can I use Google Big Query to integrate with Zephyr?
- How can I use Google BigQuery to analyze Bitcoin data?
- How do I use Google Big Query to zip files?
- How do I use wildcards in Google BigQuery?
- How can I use Google BigQuery to retrieve data from a specific year?
See more codes...