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.7.0.tar.gz (19.3 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.7.0-py3-none-win_amd64.whl (17.5 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.7.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (8.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_bigquery-1.7.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (9.4 MB view details)

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

adbc_driver_bigquery-1.7.0-py3-none-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.7.0-py3-none-macosx_10_15_x86_64.whl (9.4 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: adbc_driver_bigquery-1.7.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for adbc_driver_bigquery-1.7.0.tar.gz
Algorithm Hash digest
SHA256 41869135374d6d21d8437f9f5850ad1c420a41a9dc9ae70cfb3e70d65505899e
MD5 8334e78d23897a3e0cb1612d1379ac1c
BLAKE2b-256 d857614aae90b81995766b5257f4e931c3b8622456cfcac3573c6f6fd05214c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.7.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 119240f8346d86035e0b08285a608f7b89a65c92e599e58342e156fe1e59b079
MD5 0372770b30c55591987c0a10aaeb2f6e
BLAKE2b-256 cdf60432f7dc0aa4d1c6207578db9154850055e0696108d707c8591b31b56f9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.7.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 458f2f51721b638d98f1883c3bfcb18d5a83c26882bab0a37331628248f3b4eb
MD5 d48522fc6dedd7f89321800c2927e66b
BLAKE2b-256 59bc06117ddbe4ea3ecb49904d1a79513b3c2755a6eb906ec07919d199c93be8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.7.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a1d6a95b760fffe46cdf078d4e23dcb519a7eb2e7d13a8805fd4e2d2f0a6dd28
MD5 89861f4ae44ff01adc377c4777828b37
BLAKE2b-256 1e945211a8ea70793be1a9871f8c54317a7e250108b161d6cab921b9f4ca2a42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.7.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e5b8ac4c09b9bcc0bd5315eb94ec6768c88a3a74a725b597dedba6516222e76
MD5 9e21ffef27595f179584fc092e63c9b2
BLAKE2b-256 70ebb16286208c9189158b460a81fd39090533510450ffc9070e820cd57d2028

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.7.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 23209198ed92088e3dc8929f01b862b8c155e1c3e5887cf682893b0902f825e6
MD5 b0d94371c3bde058a1cdd652045f29e7
BLAKE2b-256 ebd86f97f74582af9cef89614ddd8ef8053c953e40359190834c1c098b54886a

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