Query any data file (CSV, JSON, TSV, Parquet) with SQL from the command line
Project description
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 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dq_cli-0.1.0.tar.gz.
File metadata
- Download URL: dq_cli-0.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df26eaea8d5e6d9211cca67241ed2c18ebe7fb4c56f0258183e158f9d6f29bc9
|
|
| MD5 |
848f4246c3846197dec1af926b2efca1
|
|
| BLAKE2b-256 |
430d28d99726b0bf2f024936c5e8af0f84b72265d24dc141d50c326a10b86880
|
Provenance
The following attestation bundles were made for dq_cli-0.1.0.tar.gz:
Publisher:
publish.yml on SasaCetkovic/dq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dq_cli-0.1.0.tar.gz -
Subject digest:
df26eaea8d5e6d9211cca67241ed2c18ebe7fb4c56f0258183e158f9d6f29bc9 - Sigstore transparency entry: 1177781670
- Sigstore integration time:
-
Permalink:
SasaCetkovic/dq@1bee059583c004c6207965a25de9eafe2815ef33 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SasaCetkovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1bee059583c004c6207965a25de9eafe2815ef33 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dq_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dq_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61e8c85b23181e7cff7c04eb69039cd3fddb18c4e1b9bc4ff234d923faaf9f68
|
|
| MD5 |
eda5f3ab527d6e301cf7556c1cb65ea1
|
|
| BLAKE2b-256 |
d067a164d3dcd7cb382ee70d078d3858277ab1f0659d8eebad87a31c709749c0
|
Provenance
The following attestation bundles were made for dq_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on SasaCetkovic/dq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dq_cli-0.1.0-py3-none-any.whl -
Subject digest:
61e8c85b23181e7cff7c04eb69039cd3fddb18c4e1b9bc4ff234d923faaf9f68 - Sigstore transparency entry: 1177781717
- Sigstore integration time:
-
Permalink:
SasaCetkovic/dq@1bee059583c004c6207965a25de9eafe2815ef33 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SasaCetkovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1bee059583c004c6207965a25de9eafe2815ef33 -
Trigger Event:
push
-
Statement type: