tosql - pipe data to sql queries
Project description
tosql - run sql queries on CLI data
tosql
is a cli tool for running SQL queries on CLI data and outputting results to json
format. It can read/write from stdin/stdout so it should work fairly naturally.
Setup
Install via pip:
pip install tosql
Quick Start
Pipe any tabular data in and use tosql
to run a sql query on it. The default table
name to select from is "df"
df | tosql "SELECT * FROM df LIMIT 2"
If you run tosql
with no arguments it will "SELECT * FROM df" by default.
df | tosql
CLI Options
tosql
has several command line options to choose from, displyed by running with the
"--help" flag.
$ tosql --help
Usage: tosql [OPTIONS] [SQL]
Options:
--version Show the version and exit.
-i, --input FILENAME Input file, default stdin
-o, --output TEXT Output file, default stdout
-f, --sql-file TEXT File containing SQL query
-t, --table-name TEXT Table name [default: df]
-c, --cols TEXT Column names, comma separated
--auto Autogenerate column names: a b c ...
--save Save the sql file to .tosql.db
--help Show this message and exit.
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
tosql-0.0.3.tar.gz
(4.3 kB
view details)
Built Distribution
tosql-0.0.3-py3-none-any.whl
(4.5 kB
view details)
File details
Details for the file tosql-0.0.3.tar.gz
.
File metadata
- Download URL: tosql-0.0.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8f06560418088498e68b61f396699cd44c1fb12b81b3485ab82026f3922bfc5 |
|
MD5 | 84bcc3a12b9ca6206f659a6078eca62f |
|
BLAKE2b-256 | b33c5a7fb6251c8c3da869077ef07605346189cfe3694f3b977541b418b6c5a9 |
File details
Details for the file tosql-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: tosql-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aceac9e7258fc88289f0025ee725c9e3dc98255b301a462a2d25d00aa924bb7 |
|
MD5 | fa94ccde529f61d660ea79013ae2471e |
|
BLAKE2b-256 | c23bad12e1200445c64d494a588c04cb966ef5d9a685d368d42f565de54906c0 |