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.8.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.8.0-py3-none-win_amd64.whl (17.7 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.8.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.8.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (9.5 MB view details)

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

adbc_driver_bigquery-1.8.0-py3-none-macosx_11_0_arm64.whl (9.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.8.0-py3-none-macosx_10_15_x86_64.whl (9.5 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: adbc_driver_bigquery-1.8.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.5

File hashes

Hashes for adbc_driver_bigquery-1.8.0.tar.gz
Algorithm Hash digest
SHA256 0b55e857a8fd470bfd8890dd882d0e32d31102ba5b5f6c840e9214326926b686
MD5 265b61b477e430c7f1425c738506620f
BLAKE2b-256 d01cfd4e1c9bc4d15a284a59832233df9bcc86cde017c1c75d21f8c921830d07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.8.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 add664b7998a83fffa334e2c92f504d0c6921d5f9e420d351d880da80646ce03
MD5 d1821e192df241b45bc9e2e8dddc1425
BLAKE2b-256 5ea26f2ad307b3fc6d2c315405025a8aa2de21579e54afd48bcc2fced720b478

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.8.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 a5908d2d32d6a6fe626900ba5d5fa2757f43d3223ead12d21c73162be1445fda
MD5 c3b360a0fc4fb50edbc5c7146cf32809
BLAKE2b-256 4f30f71012a91f75f39f4bc88c6cc4552073df092d07af0eb35ac4dc1a899016

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.8.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.8.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8760955803ed12097ce88a33c2d8d94e75d65e4ef8f695003b80d4e61275a269
MD5 4dcc316b9715612467076c0ee3820262
BLAKE2b-256 aae0831606b509df1028fcac9abe56b36201e50e93b600b4f3512c77a1beae7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.8.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 59b64ad4390c8d8d94321dbf1d1c3a460b23597cf397ba9d65bcfb2edecd8062
MD5 c73598664c59a7eb383ef32d5452c16d
BLAKE2b-256 aabb1a66ef3c40091b2b7f2289a5573b1a23f0fb0769f2b2e283272d43349690

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.8.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6d13ac05b71999cd7d5cc9bff22cbd0469e13665e7a404bcfc534096c2fa27b9
MD5 5fc30d846e43ad2f9fc56de493e039ad
BLAKE2b-256 8b61d3305955169cafcfd918437a73de497d6636d14475d162442ae69e3f45fa

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