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.7.1.tar.gz (68.6 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.7.1-py3-none-any.whl (76.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sqlexplore-0.7.1.tar.gz
  • Upload date:
  • Size: 68.6 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.7.1.tar.gz
Algorithm Hash digest
SHA256 ca57204ecf06177e88a0c3783e723036600471160d2ee654bf33fe0d42c32d83
MD5 9d61d26df9da2e4c486085042f7d0609
BLAKE2b-256 2d89dd58250352eeefa94e196c13c8d5dc2ed0f96daca621b022b7c755b3f22d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sqlexplore-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 76.8 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.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bab9886ec7a8b1ded4e06e44d3db2cda340621da81340859f8edd5f58cffa68
MD5 b9b4935b1dacc81dab1c9333210872f0
BLAKE2b-256 211a5ba793f7596905453ee2137487694ab4194938eb86806c68d1dae1554e6d

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