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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tosql-0.0.5.tar.gz
Algorithm Hash digest
SHA256 347edacefdee3440377ba7f7a997942acef00cd0c547ac8482f0c5437d13e6f6
MD5 5247988b5df8022942057a064afdda3a
BLAKE2b-256 f983ba5eca8e24848550d700900465d13cc42bfc89d84c625d47c40f6ee9ec64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tosql-0.0.5-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.11.7

File hashes

Hashes for tosql-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8feaf5df38217c502b250d8fb813b303341700c128c6fecb848b997e5e0ebccc
MD5 48c71fb95f6afa12db31aeb6ed635bb4
BLAKE2b-256 07634f7b4033e20ce3c8df36a80e25e5f45f3b23c64cfc97b1827dad524d2de7

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