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.10.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.10.0-py3-none-win_amd64.whl (17.4 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.10.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (16.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_bigquery-1.10.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (17.7 MB view details)

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

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

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.10.0-py3-none-macosx_10_15_x86_64.whl (9.6 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

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

File metadata

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

File hashes

Hashes for adbc_driver_bigquery-1.10.0.tar.gz
Algorithm Hash digest
SHA256 97bd6dd233fc61c4484c3a0c0d0dedef57ef9fde22c326a9beec675c2040005f
MD5 d37ff82aeff252a0b32dd79c48764dba
BLAKE2b-256 751d2a1cf2fa0c305de32f78224cfccfc7f59e9c6644e79115732bbcdbe52396

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.10.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b0ea1781537c96719837acc81df8f253f462d66663612749412f5f73e7c7db8c
MD5 c1c1f6bf046ea10fdcabe416837088fa
BLAKE2b-256 3e58ca7ef83bdb482bd8e53a94912afd7ced0933c6172166252f798f180ead25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.10.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 986fae9fbc742fa30868e6eee1434a1bbdaf489b4dad9676688d474ef172927c
MD5 705d81eba3a80c15d707e664aeb7819c
BLAKE2b-256 b71359244c6118babec724214e06e9b770e32135d57491960b0803c4dd5d7599

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.10.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.10.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6df2841a64b130f968f7dfceb4813a82d2667716d0218613bf791ea0a54c7372
MD5 2936791adc2a78b9c4113add81657032
BLAKE2b-256 08afb84575649675e32cba0008472eee23459b5c984b7ff2aa8be9be783b9fb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.10.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bbb96def91b1d1fd8992c2e5ee17e7a7aa1e9443603892db7bcc611ad645b927
MD5 71a5c882c022d8070cd830120c90301e
BLAKE2b-256 9ac3bc030190729cd017f17256bef626ed9dc1f0f8eb44c8383f6bc26a4cf13e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.10.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a7499e520eaec2f8aaafdac30f919e98e96e59323e85f6fd13d64f96853afac9
MD5 cdf563c0bfa5ad10319c64f112c591ab
BLAKE2b-256 4ba5a25ae1c62445b1d57381d59485336599861e7776a94405e3092d4cd2e11d

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