Metadata-Version: 2.4
Name: dq-cli
Version: 0.1.0
Summary: Query any data file (CSV, JSON, TSV, Parquet) with SQL from the command line
Project-URL: Homepage, https://github.com/SasaCetkovic/dq
Project-URL: Repository, https://github.com/SasaCetkovic/dq
Project-URL: Issues, https://github.com/SasaCetkovic/dq/issues
Author-email: Saša Ćetković <sasa.cetkovic@outlook.com>
License: MIT
License-File: LICENSE
Keywords: cli,csv,data,duckdb,json,parquet,query,sql,tsv
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: pandas>=3.0.1
Requires-Dist: pyarrow>=15.0.0
Requires-Dist: requests>=2.32.5
Description-Content-Type: text/markdown

# 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

```bash
# 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)

```bash
uv tool install dq-cli
```

### From Source

```bash
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.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 |
