Skip to main content

Ibis BigQuery backend

Project description

This package provides a [BigQuery](https://cloud.google.com/bigquery) backend for [Ibis](https://ibis-project.org/).

Installation

Supported Python Versions

Python >= 3.7, < 3.11

Unsupported Python Versions

Python < 3.7

Install with conda:

conda install -c conda-forge ibis-bigquery

Install with pip:

pip install ibis-bigquery

Usage

Connecting to BigQuery

Recommended usage (Ibis 2.x, only):

import ibis

conn = ibis.bigquery.connect(
    project_id=YOUR_PROJECT_ID,
    dataset_id='bigquery-public-data.stackoverflow'
)

Using this library directly:

import ibis
import ibis_bigquery

conn = ibis_bigquery.connect(
    project_id=YOUR_PROJECT_ID,
    dataset_id='bigquery-public-data.stackoverflow'
)

Running a query

edu_table = conn.table(
    'international_education',
    database='bigquery-public-data.world_bank_intl_education')
edu_table = edu_table['value', 'year', 'country_code', 'indicator_code']

country_table = conn.table(
    'country_code_iso',
    database='bigquery-public-data.utility_us')
country_table = country_table['country_name', 'alpha_3_code']

expression = edu_table.join(
    country_table,
    [edu_table.country_code == country_table.alpha_3_code])

print(conn.execute(
    expression[edu_table.year == 2016]
        # Adult literacy rate.
        [edu_table.indicator_code == 'SE.ADT.LITR.ZS']
        .sort_by([ibis.desc(edu_table.value)])
        .limit(20)
))

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

ibis-bigquery-2.0.0.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

ibis_bigquery-2.0.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file ibis-bigquery-2.0.0.tar.gz.

File metadata

  • Download URL: ibis-bigquery-2.0.0.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.5.0 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for ibis-bigquery-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d84e5e20baf9e15ce4c7ba1411dd23db699875afec1f6b92187574915bb20b6b
MD5 fc2f2aa3c0a0c5253f306214a673400a
BLAKE2b-256 86b361735b5aa4e5fc29a22bb2fe7d6c987d9db35766e00aed4f02cc29dfc589

See more details on using hashes here.

File details

Details for the file ibis_bigquery-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ibis_bigquery-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.5.0 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for ibis_bigquery-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23ea653d5ebddfedade53418d342974eea03af17ed0d1c4ea13effc40ab90ea4
MD5 52da8520b001c4dc602b53f4ed66704b
BLAKE2b-256 80598ced6d877e98a9f1fbb309eb29072f71a474cc7c20b696f4fbd8f77bd847

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page