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.0.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.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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

Hashes for dq_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df26eaea8d5e6d9211cca67241ed2c18ebe7fb4c56f0258183e158f9d6f29bc9
MD5 848f4246c3846197dec1af926b2efca1
BLAKE2b-256 430d28d99726b0bf2f024936c5e8af0f84b72265d24dc141d50c326a10b86880

See more details on using hashes here.

Provenance

The following attestation bundles were made for dq_cli-0.1.0.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.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

Hashes for dq_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61e8c85b23181e7cff7c04eb69039cd3fddb18c4e1b9bc4ff234d923faaf9f68
MD5 eda5f3ab527d6e301cf7556c1cb65ea1
BLAKE2b-256 d067a164d3dcd7cb382ee70d078d3858277ab1f0659d8eebad87a31c709749c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for dq_cli-0.1.0-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