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
Release history Release notifications | RSS feed
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.1.3.tar.gz
(45.4 kB
view details)
Built Distribution
File details
Details for the file ibis-bigquery-2.1.3.tar.gz
.
File metadata
- Download URL: ibis-bigquery-2.1.3.tar.gz
- Upload date:
- Size: 45.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eaf7b7f58a785c64fdc7c74c5c256f1dcc5d975e495d9836a67f8b112b3f233 |
|
MD5 | b62f5d1780dc76e84eb67e57f83c844a |
|
BLAKE2b-256 | 90faf4e3592bfa52ff3aa9025471fc1a17472854e5c6e75af9cabc9fee756182 |
File details
Details for the file ibis_bigquery-2.1.3-py3-none-any.whl
.
File metadata
- Download URL: ibis_bigquery-2.1.3-py3-none-any.whl
- Upload date:
- Size: 30.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73324f6226380a66a6b95504af15ec1d3f52f2fdbaee84171df5a47961b6dec |
|
MD5 | bdf48361edb5050cc389c4ab19d66763 |
|
BLAKE2b-256 | 9a9aaed5952570fc27891058f9f4f8900c1678c59c2b1351e277e2439f8549e0 |