Skip to main content

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

Uploaded Source

Built Distribution

tosql-0.0.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file tosql-0.0.4.tar.gz.

File metadata

  • Download URL: tosql-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for tosql-0.0.4.tar.gz
Algorithm Hash digest
SHA256 17f829305e6ac39cd0f0cb5c9711818a7ef1176a84b7b5c4a7904890ad30ffd8
MD5 781e24ba58901d68842f8327654118d8
BLAKE2b-256 d7ab094e7764ec5dcb3755c6f0ca43fc8aecd8b8e41d0d49db7ab7f28b4a06b4

See more details on using hashes here.

File details

Details for the file tosql-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: tosql-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for tosql-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ee46566939e29208292ba409ef6a884e2f5e2434bbd133e0d7055d4de694c09a
MD5 8a4249a3e1dce952af6fa388bd965c04
BLAKE2b-256 b1a35ed00e62e3232892b665c35551f118f15d44f185a6204cd627d13d779ffc

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