Skip to content

GBQ - 1.0.4

CI pipeline status PyPI PyPI - Python Version codecov

Example

from gbq import BigQuery

# BigQuery project id as listed in the Google Developers Console.
project_id = 'project_id'

# BigQuery dataset id as listed in the Google Developers Console.
dataset_id = 'dataset_id'

# BigQuery table/view id as listed in the Google Developers Console.
structure_id = 'structure_id'

# BigQuery structure definition as defined in the Google Developers Console.
json_schema = {"type": "table", "schema": [{"id": "integer"}]}

# Service account email address as listed in the Google Developers Console.
svc_account = '{"type": "service_account",   "project_id": "project_id"}'

bq = BigQuery(svc_account=svc_account, project=project_id)

bq.create_or_update_structure(project_id, dataset_id, structure_id, json_schema)

Where to Start?

To learn the basics of how to start using gbq, read the Getting Started page.

Detailed Documentation

To learn more about the various ways gbq can be used, read the Usage Guide page.