Skip to main content

SQL exploration over data files with your CLI

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.5.0.tar.gz (47.8 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.5.0-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sqlexplore-0.5.0.tar.gz
  • Upload date:
  • Size: 47.8 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.5.0.tar.gz
Algorithm Hash digest
SHA256 37e1679a029b76914983e88c27f099d8169e296c7de236b50825b0aa283fe01f
MD5 6e0f33af691c9979c392c1a8c04b6681
BLAKE2b-256 644fb63f95fff53fffa30b10f3b5468d3d0a8567dd3ff67b3364e72cd0d8d35e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sqlexplore-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 51.3 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e164ef49a7472edeaaa58e4cee882b8efd4adda77c667c06c25d679b24c092a
MD5 ed8e72e35e21ecd1cf36a0c3d35b32a2
BLAKE2b-256 0fd875258a4bfa482250cca465a7a11296085e48fccbffc52c182b4024da1757

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