bqhus: BigQuery helper utils.
Project description
bqhus
BigQuery helper utils for Python
How to use
Select from table
import bqhus
bqhus.select("SELECT * FROM `foo.bar.purchases` LIMIT 20").as_dicts()
Create table from query
bqhus.select("SELECT * FROM `some.source.table`").to_table("foo.bar.new_table")
Create temp table from query
bqhus.select("SELECT * FROM `some.source.table`").to_table("foo.bar.new_table").expires_in(days=7)
Export table to GCS as csv
bqhus.export_table("foo.bar.sample").as_csv(gzip=True).to_gcs("my-bucket", "exported-table.csv.gz")
Generate random table name
bqhus.random_table_name("prefix-here")
Development
Run tests
docker compose run bqhus
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
bqhus-0.1.2.tar.gz
(4.8 kB
view hashes)
Built Distribution
bqhus-0.1.2-py3-none-any.whl
(5.7 kB
view hashes)