Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python Client for Google BigQuery

Project Description
Python idiomatic client for Google BigQuery

Quick Start

$ pip install --upgrade google-cloud-bigquery


With google-cloud-python we try to make authentication as painless as possible. Check out the Authentication section in our documentation to learn more. You may also find the authentication document shared by all the google-cloud-* libraries to be helpful.

Using the API

Querying massive datasets can be time consuming and expensive without the right hardware and infrastructure. Google BigQuery (BigQuery API docs) solves this problem by enabling super-fast, SQL-like queries against append-only tables, using the processing power of Google’s infrastructure.

Load data from CSV

import csv

from import bigquery
from import SchemaField

client = bigquery.Client()

dataset = client.dataset('dataset_name')
dataset.create()  # API request

    SchemaField('full_name', 'STRING', mode='required'),
    SchemaField('age', 'INTEGER', mode='required'),
table = dataset.table('table_name', SCHEMA)

with open('csv_file', 'rb') as readable:
        readable, source_format='CSV', skip_leading_rows=1)

Perform a synchronous query

# Perform a synchronous query.
    'SELECT name FROM [bigquery-public-data:usa_names.usa_1910_2013] '
    'WHERE state = "TX"')
query = client.run_sync_query('%s LIMIT 100' % QUERY)
query.timeout_ms = TIMEOUT_MS

for row in query.rows:

See the google-cloud-python API BigQuery documentation to learn how to connect to BigQuery using this Client Library.

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
google_cloud_bigquery-0.27.0-py2.py3-none-any.whl (54.6 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Aug 24, 2017
google-cloud-bigquery-0.27.0.tar.gz (95.4 kB) Copy SHA256 Checksum SHA256 Source Aug 24, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting