dq — Query Any Data File with SQL
A command-line tool that lets you run SQL queries against CSV, JSON, and TSV files directly from your terminal.
Quick Start
# Query a CSV file
dq "SELECT * FROM data.csv WHERE amount > 100"
# Aggregate data
dq "SELECT category, SUM(amount) as total FROM sales.csv GROUP BY category"
# Join across files (CSV + JSON)
dq "SELECT c.name, o.total FROM customers.csv c JOIN orders.json o ON c.id = o.customer_id"
# Describe a file's schema
dq describe data.csv
# Output as CSV or JSON
dq --format csv "SELECT * FROM data.csv"
dq --format json "SELECT * FROM data.csv"
# Interactive REPL
dq
Installation
From PyPI (Recommended)
uv tool install dq-cli
From Source
uv sync
uv run main.py "SELECT * FROM your_file.csv"
Features
- SQL on files — Use standard SQL (SELECT, WHERE, GROUP BY, JOIN, ORDER BY, etc.)
- Auto-detect formats — CSV, TSV, JSON, Parquet, Excel
- Cross-file joins — Join data across different file formats
- Remote files — Query files from URLs directly
- Schema inspection —
dq describe file.csvshows columns, types, and sample values - Multiple output formats — Table (default), CSV, JSON, TSV
- Interactive REPL — Load files and run queries interactively
REPL Commands
| Command | Description |
|---|---|
/load file.csv [as alias] |
Load a file into the session |
/tables |
List loaded tables |
/describe <table> |
Show table schema |
/quit |
Exit |
Metadata
Release files for dq-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dq_cli-0.1.1.tar.gz | 6.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dq_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / dq_cli-0.1.1.tar.gz
| Download URL | dq_cli-0.1.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
267894683d74ef8bb6958e834843df9d7c196a5d143a06fc74cbd98fb13c7669
|
|
BLAKE2b-256 checksum How to use checksums |
f8d49b71dd0dad461376601579504998ba2293fd9c9e82a76c55534fc90a8a9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 25, 2026.
Transparency logRelease files / dq_cli-0.1.1-py3-none-any.whl
| Download URL | dq_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
209150df4b3f9afacf1475dda3fe11cea0e8e71d7ec5a381e83753ff78a9ed05
|
|
BLAKE2b-256 checksum How to use checksums |
451c345404c0b3888b194894687e4f4b218d609f8150537886dadcd117fed22e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 25, 2026.
Transparency logSecurity for dq-cli 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for dq_cli-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.