Skip to main content

SQL exploration over data files with your CLI and LLM

Project description

sqlexplore

Get answers from messy data files fast, without building pipelines first.

With sqlexplore, you can:

  • Inspect new datasets in minutes instead of writing setup scripts.
  • Ask ad hoc questions with SQL and get immediate feedback.
  • Move from quick profiling to exportable results in one terminal workflow.

sqlexplore is a terminal SQL workbench for flat files. Point it at a local or remote dataset, then explore with DuckDB SQL in an interactive TUI or run one-shot queries in standard CLI mode.

Useful features

  • Works with .csv, .tsv, .txt, .parquet, and .pq.
  • Accepts local paths and http(s) URLs for supported file types.
  • Accepts piped stdin text (omit data when piping) and opens in TUI by default. If no controlling tty is available, it falls back to --no-ui.
  • Interactive TUI with query editor, results grid, preview pane, and activity log.
  • SQL + helper commands for common analysis tasks: /summary, /profile, /hist, /corr, /dupes, /top, /group, and more.
  • Context-aware autocomplete for SQL clauses and helper command arguments.
  • Query history and rerun support (/history, /rerun), plus editor helpers (/last, /clear).
  • Export last result to .csv, .parquet/.pq, or .json with /save.
  • JSON-aware rendering in result cells and clickable links in preview.
  • Image bytes in BLOB or STRUCT{bytes,path} cells render as compact [img ...] tags with metadata in preview.
  • Non-interactive mode via --no-ui (optionally with --execute or --file).
  • Remote download controls: custom directory (--download-dir) and overwrite behavior (--overwrite); existing local downloads are reused by default.
  • .txt files are ingested line-by-line with derived metrics (line_number, word_count, line_hash, etc).

Usage examples

Open a local file in the TUI:

sqlexplore ./data/example.parquet

Open a remote dataset URL (downloaded first, then loaded):

sqlexplore https://github.com/dylanhogg/awesome-python/raw/refs/heads/main/github_data.parquet

Run one SQL query and exit:

sqlexplore ./data/example.parquet --execute "SELECT COUNT(*) AS n FROM data" --no-ui

Run SQL from a file and exit:

sqlexplore ./data/example.parquet --file ./queries/report.sql --no-ui

Run default sample query in plain terminal output (no TUI):

sqlexplore ./data/example.csv --no-ui

Analyze piped terminal text:

ls -lha | sqlexplore

Analyze piped terminal text in plain terminal output (no TUI):

ls -lha | sqlexplore --no-ui

Pipe text and open TUI with a startup SQL query:

ps aux | sqlexplore - --execute "SELECT line FROM data WHERE line ILIKE '%python%'"

Control remote download location and overwrite:

sqlexplore https://github.com/dylanhogg/awesome-python/raw/refs/heads/main/github_data.parquet --download-dir ./data/cache --overwrite

Typical helper commands in the editor:

/limit 5000
/rows 5000
/summary
/profile amount
/top category 10
/hist amount 20 | amount > 0
/corr tip_amount total_amount
/dupes order_id
/save ./out/results.parquet

/limit <n> sets both helper query limit and row display limit.
/rows <n> only sets row display limit.

Show installed version:

sqlexplore --version

Install

Requires Python 3.13+.

pip install sqlexplore

or:

uv tool install sqlexplore

Links

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

sqlexplore-0.6.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlexplore-0.6.0-py3-none-any.whl (62.7 kB view details)

Uploaded Python 3

File details

Details for the file sqlexplore-0.6.0.tar.gz.

File metadata

  • Download URL: sqlexplore-0.6.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sqlexplore-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b78f04c565d67c434106bce0d8ce8c82dc5ba5f9d7b77b75123a3be15b05a4a1
MD5 e40b1a3964b37fb7df7d237de3322a53
BLAKE2b-256 fbc45bb9b62179502004fafd694d4750b4785cd1310b9a3e7fd75687b4b92dc7

See more details on using hashes here.

File details

Details for the file sqlexplore-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: sqlexplore-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 62.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sqlexplore-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 164b35dba64a3d9e7d1606e1f1238324248f47644903b77a12cace8189f31ad7
MD5 0e2e0addbaf6cdf7e736758540b78294
BLAKE2b-256 ed24a51348a95cf882bcc07c8ee8e0888ca6a5fc61cfd1c67fbf88548fecf899

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page