Skip to main content

REPL for Big Query

Project description

BQ REPL

REPL for BigQuery

Commands

Commands:
\?                                    Print this stuff
\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.
                                      Shorthand for \set expanded BOOL
\clear, clear                         Clear screen


Options:
\set VARIABLE VALUE                   
Available options:
    - project PROJECT_ID              Set current project to PROJECT_ID
    - maxrows INT                     Maximum rows displayed (default=100)
    - maxwidth INT                    Maximum column width in non-expanded view (default=50)
    - max_expanded_width INT          Maximum column width in expanded view (default=100)
    - expanded BOOL                   Expanded view (default=False)
    - format_integer STR              Integer display format (default=",d")
    - format_float STR                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
  • pydata-google-auth

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 in cells
    • some kind of authentication flow if there's no service account provided
    • 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
    • ? help command

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.2.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

bqrepl-0.2.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bqrepl-0.2.0.tar.gz
  • Upload date:
  • Size: 12.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 a18faef71a4500cf88de6a9aeb598e3f22f7c8467fbbab249835c73eb38b244d
MD5 757b9ceea0fe69e45f5f67e6d8e3d5ec
BLAKE2b-256 7a0c67dae65f1e282d8006137fa7e9e6e86b142b822c9611f94cfe1f8cb4ba3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bqrepl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 305807ac955920c9ba3f7942a8b790294e3af8ec165098450a09895911986d12
MD5 90491d8b4fd14b8e9ab5089c7b522d3e
BLAKE2b-256 fea19d8a89e01578b1d4249c651d1b38867205a37ec22299f03a8bffe949430d

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