Skip to main content

REPL for Big Query

Project description

BQ REPL

REPL for BigQuery

Commands

Commands:
\d, \datasets [PROJECT]               list datasets in current project (or another project)
\p, \projects [PROJECT]               list projects (will switch projects when provided as parameter)
\t, \tables [PROJECT.]DATASET         list tables in a dataset
\c, \columns [PROJECT.]DATASET.TABLE  list columns in a table
\x, \expanded                         toggle expanded view on/off

Options:
\set VARIABLE VALUE                   set option:
Available options:
    - project PROJECT_ID              set current project to PROJECT_ID
    - maxrows 100                     maximum rows displayed (default=100)
    - maxwidth 50                     maxium column width in non-expanded view (default=50)
    - max_expanded_width 100          maximum column width in expanded view (default=100)
    - expanded False                  expanded view (default=False)
    - format_integer ,d               integer display format (default=",d")
    - format_float ,.4f               float display format (default=",.4f")

Command line arguments

$ bqrepl --help
Usage: bqrepl [OPTIONS]

  REPL for BigQuery

Options:
  -c, --credentials-file TEXT  path to credentials .json
  -p, --project TEXT           Use specific project instead of inferring from
                               credentials

  --help                       Show this message and exit.

Installation

$ pip install bqrepl

Dependencies

Python dependencies:

  • google-cloud-bigquery
  • pytz
  • click
  • prompt-toolkit
  • logzero

Tasks

Stuff to implement, in no particular order:

  • Essentials

    • nice looking results
    • query execution
    • toggle numbers formatting on/off
    • string truncation (aka max column width)
    • expanded output
    • switch GCP projects during session
    • nicer looking errors/warnings
    • multiline queries
    • multiline results
    • better authentication
    • persist query history in local database
    • query result pagination or whatever is required to keep # results sane
  • Command line arguments:

    • service-account
    • project
    • execute SQL from command line
  • code completion:

    • BQ-specific SQL syntax
    • projects/datasets/tables/columns available in the query context
    • BQ commands
  • BQ commands

    • list projects
    • list datasets
    • list tables
    • list datasets in a specific project
    • list columns
    • show info about dataset/table/view/model
    • filter list
    • copy tables
    • extract (table to bucket)
    • insert rows to table (from local file)
    • create dataset
    • create table
  • Extras

    • colour-coding nulls
    • colour-coding floats/integers/strings/dates (do I even need this?)
    • recall cached query results instead of running them again
    • view results in a horizontally scrollable table (like pgcli)
    • project/dataset tree
    • use tabs for query results?
    • async queries
    • clear screen
    • integrate ptpython?

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

bqrepl-0.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

bqrepl-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file bqrepl-0.1.1.tar.gz.

File metadata

  • Download URL: bqrepl-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.8

File hashes

Hashes for bqrepl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 46c6d10888bf9bd1e34fa806f13660d60b2b31815fb9db224f0e1857a2007975
MD5 bd333a573daa4716585edfe5e5d93d64
BLAKE2b-256 174286a4ee9fa8c1a5541f4821e41815a6716fe6da027151cdb40a8932f7e2fa

See more details on using hashes here.

File details

Details for the file bqrepl-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bqrepl-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.8

File hashes

Hashes for bqrepl-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a79210d3414a388e58a009f343351d5ac066134b8eb46d5f0ee09fc799a88b79
MD5 c3cf591bce90d79cb6b00154629005ff
BLAKE2b-256 731b40dc5f6bab8d620f51b1fa8ec0d93914057841d7b1bf163194f95be42719

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