Skip to content

Instantly share code, notes, and snippets.

@daidokoro
Last active July 31, 2018 15:43
Show Gist options
  • Save daidokoro/ac521911c4983f6141b0483274d5b045 to your computer and use it in GitHub Desktop.
Save daidokoro/ac521911c4983f6141b0483274d5b045 to your computer and use it in GitHub Desktop.
from google.cloud import bigquery
# create a client
client = bigquery.Client().from_service_account_json('<your-JSON-key.json>')
# create a query
q = "select * from dataset.table"
# run query
rows = client.query(q)
# iterate results or see errors
for r in rows:
print(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment