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

Uploaded Python 3Windows x86-64

adbc_driver_bigquery-1.9.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (16.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_bigquery-1.9.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (18.0 MB view details)

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

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

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_bigquery-1.9.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.9.0.tar.gz.

File metadata

  • Download URL: adbc_driver_bigquery-1.9.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.9.0.tar.gz
Algorithm Hash digest
SHA256 336a533b05919d6adfdc2403214d64bc01cdb461fc03950b54d9016c7e209d24
MD5 a7ee06bf3ac6f84ee1efbd1be9f35777
BLAKE2b-256 f08836e7abe682cb412feb1538cab15c2f5bbcf38ebffcfac778318ed814aa2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.9.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0faa4164916b67b928377a59738392e3cf47ff60ef6b18fbe152f081c09df6e2
MD5 9613ed17862b5265e2bbf35f880d9d21
BLAKE2b-256 e80d233583e2394feb794da847a193501782c9f03e17c3a46c4a2374c861d6af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.9.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 62ac30237310a958a8b9627179152bdd1355e41e670b07b15517a055e8c897dd
MD5 ff74cc14a2cd4d5616171e066a402067
BLAKE2b-256 ade0a5d82520145593e069a1c130f1b8da67712562b3a9b3cc35af6fe871177e

See more details on using hashes here.

File details

Details for the file adbc_driver_bigquery-1.9.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.9.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d4a4243d198d20167fad530793f62d1603a54cbac23400ed596ebc385e3a7e12
MD5 2e4bbf6dacb2e3f80662e05774ea804d
BLAKE2b-256 a5891f5d30200a07e6262802c29934905c11d67ec87ef1a4b325ab42692454e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.9.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96c78889d878613ed0b670bdc63621f1486b1fa1e576a5246b47b4d0af0ef9bd
MD5 6ed8b6142fdabe25a2558e5a399f69f1
BLAKE2b-256 f1f01594ef43d19a20a75083dd95f17a0365b6d296eea59f0d4103875753ea8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_bigquery-1.9.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 243ac1c8c20a3a7b900833e7752dd66757e361766023f28c7bae3c2ca4805bb6
MD5 4df523b5a16bb952b62f3e9d042d6490
BLAKE2b-256 1e4c21aaaa3146bbf5f8d3a01aa377264dd0574ad3385a6d4025e75ef3b697ec

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