Skip to main content

sqlexplore

License: MIT PyPI version build Latest Tag Downloads

sqlexplore is a terminal SQL explorer for flat files (.csv, .tsv, .txt, .parquet, .pq), powered by DuckDB.

Use it when you need quick answers from local files, URLs, or piped terminal output without building a separate pipeline first.

Useful features

  • Interactive TUI with query editor, results grid, cell preview, and activity log.
  • Non-interactive mode (--no-ui) for one-shot queries in plain terminal output.
  • SQL helper commands for common analysis and shaping tasks: /summary, /describe, /profile, /hist, /corr, /top, /dupes, /crosstab, /sample, /filter, /sort, /group, /agg.
  • LLM-assisted SQL generation with /llm-query, plus trace tools (/llm-history, /llm-show).
  • Query history and rerun helpers (/history, /rerun, /history-log, /rerun-log).
  • Context-aware autocomplete for SQL and helper commands.
  • Result export via /save to .csv, .parquet/.pq, or .json.
  • JSON-aware table rendering and preview, including compact image-cell tokens for image-like values.
  • Local files, HTTP(S) URLs, and stdin input (for piped text).
  • Multiple sources via repeated --data (schemas must match; sources are unioned).
  • Remote download cache controls with --download-dir and --overwrite.
  • .txt input support with derived fields like line_number, line_length, word_count, and line_hash.

Run with uvx (preferred)

Requires Python 3.13+.

Run directly without a manual install:

uvx sqlexplore --data my_data.parquet

Equivalent explicit form:

uvx --from sqlexplore sqlexplore --data my_data.parquet

Run one query and exit:

uvx sqlexplore --data https://github.com/dylanhogg/awesome-python/raw/refs/heads/main/github_data.parquet --execute "SELECT COUNT(*) AS n FROM data" --no-ui

Run SQL from file and exit:

uvx sqlexplore --data https://github.com/dylanhogg/awesome-python/raw/refs/heads/main/github_data.parquet --file ./queries/report.sql --no-ui

Use multiple inputs:

uvx sqlexplore --data ./data/january.parquet --data ./data/february.parquet

Analyze piped terminal text:

ls -lha | uvx sqlexplore

Open remote data (downloaded then loaded):

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

Install with pip

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

LLM usage (optional)

Set an API key for your chosen LiteLLM provider (for example OPENAI_API_KEY), then run:

/llm-query top 10 customers by total revenue

Optional model override:

export SQLEXPLORE_LLM_MODEL=openai/gpt-5-mini

Notes

  • --data can be omitted when piping stdin.
  • If stdin has no controlling TTY, sqlexplore falls back to --no-ui.
  • --limit sets default helper query limit. /limit also updates row display limit.
  • Logs are written to sqlexplore.log in your app log directory (with fallbacks).
  • Run sqlexplore --help to view all options.

Links

Metadata

Release files for sqlexplore 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlexplore 0.8.2
File Size Uploaded
sqlexplore-0.8.2.tar.gz 73.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlexplore 0.8.2
File Interpreter ABI Platform
sqlexplore-0.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 155.6 kB

Release files / sqlexplore-0.8.2.tar.gz

Download URL sqlexplore-0.8.2.tar.gz
Size 73.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01b500bb4c64a382723f078d6e004a822c4d5968b23c8bda21a42c69ccfd3f98
BLAKE2b-256 checksum
How to use checksums
e55f3221f6b3acec512ee6203a44bb94c88cb7cf37a3a0ad678ec45524417522
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / sqlexplore-0.8.2-py3-none-any.whl

Download URL sqlexplore-0.8.2-py3-none-any.whl
Size 82.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43e5626d54c536db0eb9eff21e122a0c7ffd4599c50e4e9b8d75946d60649bca
BLAKE2b-256 checksum
How to use checksums
a1fb8406ad01646f9af9a0dc501fe52ac18bf87d658a44521065136bfc6fb73d
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page