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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tosql-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b1a514c0975d0e9830b34ef4c5cb56255408da7f2dae7b695aa050da21b7f7c9
MD5 e18a8610574b97c346d0dfd1b2d3ce29
BLAKE2b-256 de21d3915bb7aceb449521e511273231f39d58fe6ad64f4f0d1b67c75986c1ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tosql-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3dd7ed1465bc4dca797a8dd003250df74774af2aed4b908d9937e98c89b0a92
MD5 ffd86f4e923e4f5b5dba8086a4a4de06
BLAKE2b-256 d0957d15ab0c81404d9e43f0c61561327ec9bb1187c3fa69d2177893f8344c87

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