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.2.0.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

ibis_bigquery-2.2.0-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ibis-bigquery-2.2.0.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for ibis-bigquery-2.2.0.tar.gz
Algorithm Hash digest
SHA256 a5fc55f181c9494bf88f1d2dc5a5ec24d2dd5ac1e96e1a295279eda0feb4e0c4
MD5 e5e6e58bfdbacc7cdc1e7b41d5f2660d
BLAKE2b-256 c082e7336a3fef4b0540fdaf2d9fa27c22f5681d54b184a7b6b6406bb7a70f7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ibis_bigquery-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c943ce63f4535e773754237271eb0282142415ff3c4f1164eecbea930fe5d374
MD5 90a0f4dc634625ceadfc6263e4fe73b8
BLAKE2b-256 bffdb2a6754cdda5307eee949141d13d3b26275a397468108876caf28715cd3a

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