Metadata-Version: 2.4
Name: csv-query-cli
Version: 0.1.0
Summary: Query CSV files with SQL from the terminal — zero dependencies
Author: Martin Uhlmann
License: MIT
Project-URL: Homepage, https://github.com/martinu/csvql
Project-URL: Repository, https://github.com/martinu/csvql
Keywords: csv,sql,query,cli,data,terminal
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Classifier: Topic :: Utilities
Classifier: Topic :: Office/Business
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# csvql

**Query CSV files with SQL from the terminal.**

No database to set up, no Python library to learn — just `csvql data.csv` and write `SELECT`.

```bash
pip install csvql

# Count and aggregate
csvql sales.csv -q "SELECT region, COUNT(*) as orders, SUM(amount) as revenue FROM sales GROUP BY region ORDER BY 2 DESC"

# Inspect columns
csvql --tables messy_data.csv

# JSON output (pipe into jq)
csvql --json data.csv -q "SELECT * FROM data WHERE status = 'active'"

# Custom delimiter
csvql -d';' data.tsv -q "SELECT * FROM data"
```

## How it works

Loads each CSV into an in-memory SQLite table, runs your SQL, and prints the result. Zero external dependencies — uses only Python's stdlib `csv`, `sqlite3`, and `json` modules.

Column names are derived from the header row. Tables are named after the file name. Multiple files can be queried together if they share the same path prefix.

## Why

Every data worker has the muscle memory for SQL but reaches for `grep`, `awk`, or a spreadsheet when the data happens to be in CSV. `csvql` lets you use SQL directly.

## License

MIT
