Skip to main content

An ADBC driver for working with BigQuery.

Project description

ADBC BigQuery Driver for Python

This package contains bindings for the BigQuery driver, using the driver manager to provide a DBAPI 2.0/PEP 249-compatible interface on top.

Building

Dependencies: a build of the BigQuery driver, and the adbc-driver-manager Python package. Optionally, install PyArrow to use the DBAPI 2.0-compatible interface.

Set the environment variable ADBC_BIGQUERY_LIBRARY to the path to libadbc_driver_bigquery.{dll,dylib,so} before running pip install.

# If not already installed
pip install -e ../adbc_driver_manager

export ADBC_BIGQUERY_LIBRARY=/path/to/libadbc_driver_bigquery.so
pip install --no-deps -e .

For users building from the arrow-adbc source repository, you can alternately use CMake to manage library dependencies and set environment variables for you. Assuming you specify -DADBC_DRIVER_BIGQUERY=ON you can also add -DADBC_BUILD_PYTHON=ON to define a python target.

For example, assuming you run cmake from the project root:

cmake -S c -B build --preset debug -DADBC_BUILD_PYTHON=ON -DADBC_DRIVER_BIGQUERY=ON
cmake --build build --target python

will properly build and install the Python library for you.

See CONTRIBUTING.md for details on the general build process.

Example

import adbc_driver_bigquery.dbapi
from adbc_driver_bigquery import DatabaseOptions

db_kwargs = {
    DatabaseOptions.AUTH_TYPE.value: DatabaseOptions.AUTH_VALUE_CREDENTIALS_FILE,
    DatabaseOptions.CREDENTIALS.value: "credentials.json",
    DatabaseOptions.PROJECT_ID.value: "bigquery-poc-418913",
    DatabaseOptions.DATASET_ID.value: "google_trends",
    DatabaseOptions.TABLE_ID.value: "small_top_terms",
}
with adbc_driver_bigquery.dbapi.connect(db_kwargs) as conn:
    with conn.cursor() as cur:
        cur.execute("SELECT 1")
        print(cur.fetch_arrow_table())

Testing

To run the tests, use pytest:

$ pytest -vvx

See CONTRIBUTING.md for details on the general test process.

Project details


Download files

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

Source Distribution

adbc_driver_bigquery-1.5.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

adbc_driver_bigquery-1.5.0-py3-none-win_amd64.whl (16.2 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_bigquery-1.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

adbc_driver_bigquery-1.5.0-py3-none-macosx_11_0_arm64.whl (8.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.5.0-py3-none-macosx_10_15_x86_64.whl (8.7 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

Details for the file adbc_driver_bigquery-1.5.0.tar.gz.

File metadata

  • Download URL: adbc_driver_bigquery-1.5.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for adbc_driver_bigquery-1.5.0.tar.gz
Algorithm Hash digest
SHA256 d396d5454739b61e0b988584c25d9c06f7a8ec01a6fa2be46c7086da7016231f
MD5 34e9a8d2623d4f85757f9198f5c6b1d4
BLAKE2b-256 35cf05c630f2c076db860a1c70a1c2edaa6345a2d86090c498f5ad89f99ce727

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.5.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 23652f2275eed25de1d55d4990bff36744544ec3034bb656489425cb197b8d6d
MD5 66adf5c3ca6a555cdefa62d4b94dd1e6
BLAKE2b-256 a7c6e0f231ef145f30475f7b759ce2c74ed19db0a681295ea69fe55d572ee433

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4d21365c0f4816e0f28605f05f88c365df82ab2d13cd7d3bd8d17449baf97770
MD5 c135994705dbde69a761e151856f755a
BLAKE2b-256 9718a1044bb04d0dac6599cf7b6669c394fbf136485a518230fd7a84389eb9e0

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fff37309963e710ffbb65ddf038cd34eef9486c1e155fd2e1afc9f72b418b72
MD5 0d7b663a20253209a199a06d37cf262f
BLAKE2b-256 715765e52fd0d460a85188f5afa96346aba8a6eab2c1a7a330c98efaf176f90c

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 446aa7affc30825fd01b8f197f3512f18f04d7480c61188e5f118478f71a2e6e
MD5 b0ef428a11425bae5372479cc705e073
BLAKE2b-256 6f475f857fba33cd70949d06757915387a021326955b73fe927d93115e277704

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.5.0-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.5.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 db0e666447c46e0d74948ef6a11ef2eff0457e8359d7b3c2be75452f92251cb5
MD5 153e0f6fedfdaef911495b72a9d84965
BLAKE2b-256 f4331df7ad5f430d07a93f0126028ad0d151a33c80caccbf070e773128771de9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page