semvec/pypi-packages huggingface dataset:
csvq-cli 0.1.0
CSV/TSV query, filter, transform, and convert from the command line
License: MIT
Requires Python: >=3.9
Keywords: csv, tsv, query, filter, cli, data, tabular

# csvq-cli

CSV/TSV query, filter, transform, and convert from the command line.

## Install

```bash
pip install csvq-cli
```

## Commands

| Command | Description |
|---------|-------------|
| `csvq head` | Show headers and preview rows |
| `csvq count` | Count rows |
| `csvq select` | Select specific columns |
| `csvq filter` | Filter rows (==, !=, >, <, contains, matches, etc.) |
| `csvq sort` | Sort by column |
| `csvq unique` | Unique values with counts |
| `csvq stats` | Numeric stats (min, max, mean, median, sum) |
| `csvq grep` | Search rows matching regex |
| `csvq sample` | Random sample of rows |
| `csvq merge` | Merge multiple CSV files |
| `csvq to-json` | Convert to JSON |
| `csvq to-tsv` | Convert to TSV |
| `csvq to-md` | Convert to Markdown table |

## Examples

```bash
# Preview a file
csvq head data.csv

# Filter and convert
csvq filter data.csv status == active --json

# Stats on a column
csvq stats sales.csv revenue

# Grep across all columns
csvq grep data.csv "error|warning"

# Select columns and sort
csvq select data.csv name email | csvq sort - name

# Pipe from stdin
cat data.csv | csvq count
```

All commands support `--json` output. Auto-detects delimiter (CSV, TSV, semicolon, pipe).

## For AI Agents

See [SKILL.md](SKILL.md) for agent-optimized documentation.

## License

MIT