CLI based SQL client for local data
Project description
clidb
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)
Views can be joined together, for example:
select * from iris natural join iris_variety
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clidb-0.2.0.tar.gz.
File metadata
- Download URL: clidb-0.2.0.tar.gz
- Upload date:
- Size: 684.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Darwin/21.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7121d69915e3585f7a3f272dfbc21ae82e42e70c1c12a0865c7763a896d13b54
|
|
| MD5 |
196af50855542dfe9f041098a0d2e12c
|
|
| BLAKE2b-256 |
17bca5c988aaf0b9a2278affaa32338b47ddc5dc256273a42af4e6ac9ccf94f7
|
File details
Details for the file clidb-0.2.0-py3-none-any.whl.
File metadata
- Download URL: clidb-0.2.0-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Darwin/21.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4073cd79813a36797debeb59ce854961835aeb7956a6a78bb819b4c9d83651cf
|
|
| MD5 |
a84ac1b8df7675657664b92caa8938c6
|
|
| BLAKE2b-256 |
df9cbef048e1937d4a425a59494a551c072b7267b7e8977a1b2e8e2f972f2b72
|