Skip to main content

BigQuery query - bqq

"Simplified, enriched bq query"

  • prompted queries (billed project, cost, size), using dry run
  • synchronize jobs from cloud (results linked with console.cloud.google.com)
  • super fast search through query job history
  • download and preview result data

Requirements

brew install fzf
brew install --cask google-cloud-sdk

Installation

pip install bqq

Usage

1. Initialize bqq

bqq --init

2. Set up default credentials

Underlying BigQuery client relies on application-default credentials

gcloud auth application-default login

Examples

Usage: bqq [OPTIONS] [SQL]

  BiqQuery query.

Options:
  -f, --file FILENAME  File containing SQL
  -y, --yes            Automatic yes to prompt
  -h, --history        Search local history
  -d, --delete         Delete job from history (local & cloud)
  -i, --info           Show gcloud configuration
  --clear              Clear local history
  --sync               Sync history from cloud
  --init               Initialize bqq environment
  --version            Show the version and exit.
  --help               Show this message and exit.

Query

bqq "SELECT repository.url, repository.created_at FROM bigquery-public-data.samples.github_nested LIMIT 100"
Billing project = my-google-project
Estimated size = 150.3 MiB
Estimated cost = +0.00 $
Do you want to continue? [y/N]: y

Query in file

bqq -f query.sql

Synchronize

bqq --sync
Syncing jobs information  [####################################]

Search history

bqq -h
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Creation time = 2020-01-01 00:00:00
Project = my-google-project
Account = account@google.com
Query cost = +0.00 $
Slot time =
Console link = https://console.cloud.google.com/bigquery?project=my-google-project&j=bq:US:3ff1f9b0-ae38-4d83-a711-7f28f74ff769&page=queryresults
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
SELECT repository.url, repository.created_at FROM bigquery-public-data.samples.github_nested LIMIT 100
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Download result ? [y/N]:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ url                                                            ┃ created_at                ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ https://github.com/liferay/liferay-plugins                     ┃ 2009/09/25 15:56:21 -0700 ┃
┃ https://github.com/plataformatec/simple_form                   ┃ 2009/12/28 06:23:48 -0800 ┃
┃ https://github.com/cakephp/datasources                         ┃ 2009/12/02 21:07:40 -0800 ┃
┃ https://github.com/ezsystems/ezfind                            ┃ 2010/10/19 13:46:09 -0700 ┃
┃ https://github.com/EightMedia/hammer.js                        ┃ 2012/03/02 04:58:28 -0800 ┃
┃ https://github.com/saasbook/hw3_rottenpotatoes                 ┃ 2012/02/03 10:33:06 -0800 ┃
┃ https://github.com/JetBrains/kotlin                            ┃ 2012/02/13 09:29:58 -0800 ┃
┃ https://github.com/php/php-src                                 ┃ 2011/06/15 18:52:25 -0700 ┃
┃ https://github.com/saasbook/hw4_rottenpotatoes                 ┃ 2012/02/17 13:23:02 -0800 ┃
┃ https://github.com/AFNetworking/AFNetworking                   ┃ 2011/05/31 14:28:44 -0700 ┃
┃ https://github.com/php/php-src                                 ┃ 2011/06/15 18:52:25 -0700 ┃
┃ https://github.com/mono/MonoGame                               ┃ 2011/04/06 17:23:40 -0700 ┃
...

Metadata

Release files for bqq 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bqq 0.2.2
File Size Uploaded Provenance Actions
bqq-0.2.2.tar.gz 19.2 kB Without provenance Details for bqq-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bqq 0.2.2
File Interpreter ABI Platform Actions
bqq-0.2.2-py3-none-any.whl Python 3 none any Details for bqq-0.2.2-py3-none-any.whl

Total release size: 41.7 kB

Release files / bqq-0.2.2.tar.gz

Download URL bqq-0.2.2.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e796458e005209e4c28f9d399461c6e3363090dca578fc4076580b14483535b8
BLAKE2b-256 checksum
How to use checksums
ea8dcdcd516ef7e3b4db0c08c9211c165011b8f9f1d38e9cb4f392f70612acb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / bqq-0.2.2-py3-none-any.whl

Download URL bqq-0.2.2-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f353b3b2905b13aa483df74c74d94384438e979b39bb756620b26bbfabcfda4
BLAKE2b-256 checksum
How to use checksums
5e852ca46a5869df3b44716af6aecb8da0d300e38ca3a27e05bf4f66990a7996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Security for bqq 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page