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.4.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.4.0-py3-none-win_amd64.whl (15.8 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_bigquery-1.4.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.6 MB view details)

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

adbc_driver_bigquery-1.4.0-py3-none-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.4.0-py3-none-macosx_10_15_x86_64.whl (8.5 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: adbc_driver_bigquery-1.4.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.4.0.tar.gz
Algorithm Hash digest
SHA256 c1fdef3678fc2b55debc70a4941c3a0621b95d4e1e2cfb01106f1e605340d430
MD5 c4f55a94ab247b9d7c7cb62540a24b2b
BLAKE2b-256 e51f7db5b35d4b9293464ec5210f2a461c671d225383b82f54b0191feaf63710

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9c02cc0a46660a0d85b0a529be94e4b8da5cdf1d72c5720d20df770ac1d2a693
MD5 94680d985ae4cda6b96b764b560b2f39
BLAKE2b-256 4dbcce991ebc9bcb584402b2236da2882ef5a9e391005fa15e43516818b6a62e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c5415257eb41c177cf289b709a0b604823eabf7cc4467a60c0f0cf8b6616804c
MD5 ee2411b38b6f405f5929138c5d903ca8
BLAKE2b-256 338e84774229f3b0abb48335800d4c7f2ca066cb0d18af58da57a69399063a12

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.4.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.4.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee48f22a06ee99cd526d5f5f3cefef863724174d80273413f54e43ebedef2367
MD5 f9eda100291ef6f7ab06830745fbc059
BLAKE2b-256 53501d7db5e0edab47e73e078e3fc65e136c7a6765ed8399d98f7c6222c224cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43d51940a2890c3b4f8528556e97414838e701364a79a9ea11f75ba5840095cc
MD5 953cce360a53a40c33611146b1070829
BLAKE2b-256 32bd90a739b6a550510af681187dd78c2fb9e6cd1185ac933b0d1d4127da9f55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.4.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 507898e3ce6d6737f433045247fe061193468e5f06fa103ed911861a013f1e72
MD5 a989a6c6de86be08c608a80a5cc0931d
BLAKE2b-256 63f01dfc44170a4160a008bbc71137d64fa10001907e71b5cdd4424badac1d50

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