Skip to main content

CLI based SQL client for local data

Project description

clidb

screenshot

clidb is a command line sql client for individual data files, allowing these to be queried (even joined) and viewed. It natively supports CSV and parquet formats, with support for other file types available via the optional extras dependency.

Data Formats

The following file types can be opened as views in clidb without extras:

  • csv
  • parquet(.gz)

With pandas installed, the following are also supported:

  • json(l)
  • xls(x)
  • clipboard
  • ...

Usage

This package can be installed with:

pip install "clidb[extras]"

and executed via:

clidb

Arguments

If a filename is supplied as an argument to clidb then it will open the data file as a view.

If a directory or S3 path is supplied then the directory view will open in that location.

For example:

clidb data/iris.csv

or

clidb s3://somebucket/data/

The contents of the clipboard can be converted into a view (e.g. after copying from Google Sheets), using the --clipboard argument:

clidb --clipboard

For some data sources, it can be helpful to render lines that separate rows. This can be enabled via the row-lines option:

clidb --row-lines

Advanced Usage

New views can be created from an opened file. For example if iris.csv was opened as the view iris, then we could create a new view:

create view iris_variety as (select variety, avg("petal.length") from iris group by variety)

create view

Views can be joined together, for example:

select * from iris natural join iris_variety

join

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

clidb-0.2.2.tar.gz (10.4 kB view hashes)

Uploaded source

Built Distribution

clidb-0.2.2-py3-none-any.whl (10.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page