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 ...
--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.1.tar.gz
(4.1 kB
view details)
Built Distribution
tosql-0.0.1-py3-none-any.whl
(4.3 kB
view details)
File details
Details for the file tosql-0.0.1.tar.gz
.
File metadata
- Download URL: tosql-0.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcd79f21c08bf77108085806ae5d2f2e9bd708d1e9325fe5c3310c33c9004ddc |
|
MD5 | ce0ea6c3fee8a4429aacf972259325ee |
|
BLAKE2b-256 | e0179576e6dad6dd38b09b8eef189c6566f85221244e424fa664a5b2bd72c25c |
File details
Details for the file tosql-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: tosql-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.3 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 | accc31ff8a86e7ba31a845441679394da061f00b31d853cb491724ce4432d1dc |
|
MD5 | 0035d5c7fa860e043245d50830ee4f0c |
|
BLAKE2b-256 | 96fc1710d4d5623438d9d9309dcf742ab89bd834f7d01b625d2785b926eba9c2 |