Skip to main content

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 inspectiondq describe file.csv shows 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dq_cli-0.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dq_cli-0.1.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file dq_cli-0.1.1.tar.gz.

File metadata

  • Download URL: dq_cli-0.1.1.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

Hashes for dq_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 267894683d74ef8bb6958e834843df9d7c196a5d143a06fc74cbd98fb13c7669
MD5 6a424b316bb5c47874ed37f7e9fec6db
BLAKE2b-256 f8d49b71dd0dad461376601579504998ba2293fd9c9e82a76c55534fc90a8a9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dq_cli-0.1.1.tar.gz:

Publisher: publish.yml on SasaCetkovic/dq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dq_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dq_cli-0.1.1-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

Hashes for dq_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 209150df4b3f9afacf1475dda3fe11cea0e8e71d7ec5a381e83753ff78a9ed05
MD5 3961dc3f3a1a2b0cfebca92f1e2b6648
BLAKE2b-256 451c345404c0b3888b194894687e4f4b218d609f8150537886dadcd117fed22e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dq_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on SasaCetkovic/dq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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