Skip to content

martintupy/bq-meta

Repository files navigation

BigQuery metadata

"Inspect BigQuery metadata faster"

  • Interactive CLI
  • Quick search through available projects, datasets, tables
  • View up to date table's metadata and it's schema
  • Local history of searched tables

Requirements

brew install fzf

search through list of values (i.e. project, dataset, tables) is done using fzf

Installation

  1. Install as python package using pypi, this will create executable in /usr/local/bin/bq-meta

    pip install bq-meta
  2. Initialize bq-meta

    bq-meta --init
  3. Follow on screen prompts

    • create configuration
    • login to the google account using browser (Account is separated from gcloud cli)

Run

To open interactive CLI, simply run

bq-meta

cli

Table metadata

To view table metadata, press o key and select through project, dataset, table.

metadata

Table metadata can be refreshed, press r to fetch fresh metadata

It's also possible to run bq-meta directly with FULL_TABLE_ID

bq-meta bigquery-public-data:github_repos.commits

Table schema

Once table metadata is opened, press s key to view it's schema

schema

Open in console

You can open table in console.cloud.google.com by pressing c key

browser

Search history

Every viewed table is saved to the history. To search through history, press h key

history

Other

Usage: python -m bq_meta [OPTIONS] [FULL_TABLE_ID]

  BiqQuery metadata

Options:
  --raw             View raw response from the BigQuery for specific 'FULL_TABLE_ID'
  --init            Initialize 'bq-meta' configuration
  --info            Print info of currently used account
  --fetch-projects  Fetch available google projects
  --version         Show the version and exit.
  --help            Show this message and exit.