<jupyter_start><jupyter_text>Access Public Data from BigQueryThis example illustrates how to create a Google cloud credentials object from your Data Observatory enabled CARTO account.<jupyter_code>from cartoframes.auth import Credentials

creds = Credentials.from_file('creds.json')
from google.oauth2.credentials import Credentials as GoogleCredentials

gcloud_project, gcloud_token = creds.get_gcloud_credentials()
gcloud_credentials = GoogleCredentials(gcloud_token)
from google.cloud import bigquery, storage

bq_client = bigquery.Client(project=gcloud_project, credentials=gcloud_credentials)
gcs_client = storage.Client(project=gcloud_project, credentials=gcloud_credentials)<jupyter_output><empty_output><jupyter_text>As an example, the following code shows how to use the Google BigQuery client to access to a public dataset from Data Observatory:<jupyter_code>from cartoframes.data.observatory import Dataset

dataset = Dataset.get('acs_sociodemogr_8c2655e0')
dataset.id
query_job = bq_client.query('SELECT * FROM `{}` LIMIT 1'.format(dataset.id))
results = query_job.result()
results.schema[0:3]
for row in results:
    print(row['geoid'], row['total_pop'])<jupyter_output>18025 10598.0
{'fraction_non_alphanumeric': 0.08193979933110368, 'fraction_numerical': 0.017558528428093644, 'mean_word_length': 8.207692307692307, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '99600', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 382, 'n_tokens_neox': 365, 'n_words': 92, 'path': 'docs/examples/data_observatory/google_cloud_credentials.ipynb', 'repo_name': 'CartoDB/cartoframes', 'size': '1196'}