google-cloud-bigquery 3.41.0


pip install google-cloud-bigquery

  Latest version

Released: Mar 30, 2026

Project Links

Meta
Author: Google LLC
Requires Python: >=3.8

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Operating System
  • OS Independent

Topic
  • Internet

GA pypi versions

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

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Google Cloud BigQuery API.

  4. Setup Authentication.

Installation

Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.

With virtualenv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

Supported Python Versions

Python >= 3.9

Unsupported Python Versions

Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, and Python == 3.8.

The last version of this library compatible with Python 2.7 and 3.5 is google-cloud-bigquery==1.28.0.

Mac/Linux

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-bigquery

Windows

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-bigquery

Example Usage

Perform a query

from google.cloud import bigquery

client = bigquery.Client()

# Perform a query.
QUERY = (
    'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` '
    'WHERE state = "TX" '
    'LIMIT 100')
query_job = client.query(QUERY)  # API request
rows = query_job.result()  # Waits for query to finish

for row in rows:
    print(row.name)

Instrumenting With OpenTelemetry

This application uses OpenTelemetry to output tracing data from API calls to BigQuery. To enable OpenTelemetry tracing in the BigQuery client the following PyPI packages need to be installed:

pip install google-cloud-bigquery[opentelemetry] opentelemetry-exporter-gcp-trace

After installation, OpenTelemetry can be used in the BigQuery client and in BigQuery jobs. First, however, an exporter must be specified for where the trace data will be outputted to. An example of this can be found here:

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
tracer_provider = TracerProvider()
tracer_provider = BatchSpanProcessor(CloudTraceSpanExporter())
trace.set_tracer_provider(TracerProvider())

In this example all tracing data will be published to the Google Cloud Trace console. For more information on OpenTelemetry, please consult the OpenTelemetry documentation.

3.41.0 Mar 30, 2026
3.40.1 Feb 12, 2026
3.40.0 Jan 08, 2026
3.39.0 Dec 15, 2025
3.38.0 Sep 17, 2025
3.37.0 Sep 09, 2025
3.36.0 Aug 20, 2025
3.35.1 Jul 24, 2025
3.35.0 Jul 16, 2025
3.34.0 May 29, 2025
3.33.0 May 19, 2025
3.32.0 May 12, 2025
3.31.0 Mar 25, 2025
3.30.0 Feb 27, 2025
3.29.0 Jan 21, 2025
3.28.0 Jan 15, 2025
3.27.0 Nov 11, 2024
3.26.0 Sep 26, 2024
3.25.0 Jun 20, 2024
3.24.0 Jun 04, 2024
3.23.1 May 21, 2024
3.23.0 May 16, 2024
3.22.0 May 06, 2024
3.21.0 Apr 18, 2024
3.20.1 Apr 01, 2024
3.20.0 Mar 27, 2024
3.19.0 Mar 11, 2024
3.18.0 Mar 04, 2024
3.17.2 Feb 06, 2024
3.17.1 Jan 25, 2024
3.17.0 Jan 24, 2024
3.16.0 Jan 12, 2024
3.15.0 Jan 09, 2024
3.14.1 Dec 13, 2023
3.14.0 Dec 11, 2023
3.14.0rc0 Nov 30, 2023
3.13.0 Oct 30, 2023
3.12.0 Oct 03, 2023
3.11.4 Jul 19, 2023
3.11.3 Jun 27, 2023
3.11.2 Jun 22, 2023
3.11.1 Jun 13, 2023
3.11.0 Jun 01, 2023
3.10.0 Apr 19, 2023
3.9.0 Mar 28, 2023
3.8.0 Mar 27, 2023
3.7.0 Mar 13, 2023
3.6.0 Feb 22, 2023
3.5.0 Feb 01, 2023
3.4.2 Jan 18, 2023
3.4.1 Dec 12, 2022
3.4.0 Nov 18, 2022
3.3.6 Nov 04, 2022
3.3.5 Oct 10, 2022
3.3.3 Sep 29, 2022
3.3.2 Aug 17, 2022
3.3.1 Aug 09, 2022
3.3.0 Jul 26, 2022
3.2.0 Jun 08, 2022
3.1.0 May 09, 2022
3.0.1 Mar 30, 2022
3.0.0 Mar 30, 2022
3.0.0b1 Nov 16, 2021
2.34.4 Jun 09, 2022
2.34.3 Mar 30, 2022
2.34.2 Mar 07, 2022
2.34.1 Mar 02, 2022
2.34.0 Feb 18, 2022
2.33.0 Feb 17, 2022
2.32.0 Jan 13, 2022
2.31.0 Dec 02, 2021
2.30.1 Nov 04, 2021
2.30.0 Nov 03, 2021
2.29.0 Oct 27, 2021
2.28.1 Oct 07, 2021
2.28.0 Sep 30, 2021
2.27.1 Sep 27, 2021
2.27.0 Sep 27, 2021
2.26.0 Sep 01, 2021
2.25.2 Sep 01, 2021
2.25.1 Aug 25, 2021
2.25.0 Aug 24, 2021
2.24.1 Aug 19, 2021
2.24.0 Aug 11, 2021
2.23.3 Aug 09, 2021
2.23.2 Jul 29, 2021
2.23.1 Jul 28, 2021
2.23.0 Jul 27, 2021
2.22.1 Jul 22, 2021
2.22.0 Jul 19, 2021
2.21.0 Jul 13, 2021
2.20.0 Jun 07, 2021
2.19.0 Jun 07, 2021
2.18.0 Jun 02, 2021
2.17.0 May 21, 2021
2.16.1 May 13, 2021
2.16.0 May 06, 2021
2.15.0 Apr 29, 2021
2.14.0 Apr 26, 2021
2.13.1 Mar 23, 2021
2.13.0 Mar 22, 2021
2.12.0 Mar 16, 2021
2.11.0 Mar 09, 2021
2.10.0 Feb 25, 2021
2.9.0 Feb 18, 2021
2.8.0 Feb 10, 2021
2.7.0 Jan 27, 2021
2.6.2 Jan 11, 2021
2.6.1 Dec 09, 2020
2.6.0 Dec 07, 2020
2.5.0 Dec 02, 2020
2.4.0 Nov 16, 2020
2.3.1 Nov 05, 2020
2.2.0 Oct 19, 2020
2.1.0 Oct 08, 2020
2.0.0 Sep 30, 2020
1.28.3 Apr 18, 2023
1.28.2 Jun 09, 2022
1.28.1 Apr 06, 2022
1.28.0 Sep 22, 2020
1.27.2 Aug 18, 2020
1.26.1 Jul 27, 2020
1.26.0 Jul 21, 2020
1.25.0 Jun 09, 2020
1.24.0 Feb 03, 2020
1.23.1 Dec 16, 2019
1.23.0 Dec 12, 2019
1.22.0 Nov 14, 2019
1.21.0 Oct 17, 2019
1.20.0 Sep 16, 2019
1.19.1 Sep 17, 2019
1.19.0 Sep 03, 2019
1.18.1 Sep 17, 2019
1.18.0 Aug 08, 2019
1.17.1 Sep 17, 2019
1.17.0 Jul 12, 2019
1.16.1 Sep 17, 2019
1.16.0 Jul 02, 2019
1.15.1 Sep 17, 2019
1.15.0 Jun 14, 2019
1.14.1 Sep 17, 2019
1.14.0 Jun 05, 2019
1.13.1 Sep 17, 2019
1.13.0 May 31, 2019
1.12.2 Sep 17, 2019
1.12.1 May 21, 2019
1.12.0 May 17, 2019
1.11.4 Sep 17, 2019
1.11.3 May 15, 2019
1.11.2 Apr 05, 2019
1.11.1 Apr 04, 2019
1.10.1 Sep 17, 2019
1.10.0 Mar 06, 2019
1.9.1 Sep 17, 2019
1.9.0 Feb 05, 2019
1.8.2 Sep 17, 2019
1.8.1 Dec 18, 2018
1.8.0 Dec 10, 2018
1.7.2 Sep 17, 2019
1.7.0 Nov 06, 2018
1.6.2 Sep 17, 2019
1.6.1 Dec 18, 2018
1.6.0 Oct 03, 2018
1.5.2 Sep 17, 2019
1.5.1 Sep 21, 2018
1.5.0 Aug 02, 2018
1.4.0 Jul 13, 2018
1.3.0 Jun 07, 2018
1.2.0 May 30, 2018
1.1.0 Apr 18, 2018
1.0.0 Apr 11, 2018
0.32.0 Apr 04, 2018
0.31.0 Feb 28, 2018
0.30.0 Feb 08, 2018
0.29.0 Jan 08, 2018
0.28.0 Oct 31, 2017
0.27.0 Aug 24, 2017
0.26.0 Aug 05, 2017
0.25.0 Jun 26, 2017
0.24.0 Mar 31, 2017
0.23.0 Feb 24, 2017
0.22.1 Dec 10, 2016
0.22.0 Dec 06, 2016
0.21.0 Nov 14, 2016
0.20.0 Sep 29, 2016
Extras:
Dependencies:
google-api-core[grpc] (<3.0.0,>=2.11.1)
google-auth (<3.0.0,>=2.14.1)
google-cloud-core (<3.0.0,>=2.4.1)
google-resumable-media (<3.0.0,>=2.0.0)
packaging (>=24.2.0)
python-dateutil (<3.0.0,>=2.8.2)
requests (<3.0.0,>=2.21.0)