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.6.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.6.0-py3-none-win_amd64.whl (17.0 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_bigquery-1.6.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

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

adbc_driver_bigquery-1.6.0-py3-none-macosx_11_0_arm64.whl (8.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.6.0-py3-none-macosx_10_15_x86_64.whl (9.0 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: adbc_driver_bigquery-1.6.0.tar.gz
  • Upload date:
  • Size: 19.2 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.6.0.tar.gz
Algorithm Hash digest
SHA256 4b3357ae3f6ad3a4b786bf62d50bce497a791e6060511abf4b15ba8abfaf8876
MD5 64cbde829665d97cc0e9e08b60c0bc29
BLAKE2b-256 ede79b945131d65370b56d913d30370d3840da0fdbc2ca7b09c53f9af17193d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.6.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 63bad2e95e5efd4aad40e98e10944df68f9d8b3ed09eaea1e846b624a2840039
MD5 bd41ba0414d1b76d66237f1c41ef0c09
BLAKE2b-256 74f43a0cf6a68a11734648918035072a8a9036ba3339dd51f2cb25d401b7d35b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 46a114a9a5ea7dea983ec956824cc82a06940f8c1edc271ce5160ba405367b3e
MD5 d5c0d60750e9e05c0342e7ef1baa853a
BLAKE2b-256 ed5cdebd7f6d77ffc4a5db33027bd8c6288e41ed8cd7b53953ab2f0ad9d6d968

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.6.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.6.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8a5b78155a35940bb98b7727d946c25acc8c221b3a343cb38b6c14398a16908
MD5 e7a1f50dbcaa6e3d16b60448ae38a4ba
BLAKE2b-256 e724a62e00e0d2348d6bbe644f873035ac678b528c131d4c0aa55e00abc0a6cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.6.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a5851c9a4af8fed1aff419aaa8cd486376a4da2c16d35c054ff0677278079d48
MD5 e298a090ca1080fc7d274e4ae5032cc0
BLAKE2b-256 c266729a653064d727fefca93e4f571d74dddc22f7da27945adff7a6ebe3b25f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.6.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4367b7f0d48ae12d51207f68fc395f0bb428143e6879348289ce865044618d15
MD5 33f9e16b119b1b2e598782f6acf804a4
BLAKE2b-256 e5e5ed867239ffc7e879e376ddca26b347606d3b9b6a19fe5ab27f5873e5ff62

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