csv-query
Run SQL queries against CSV/TSV/Excel files using Polars SQL engine
Skill by Kilo-Org
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kilo-org-csv-query
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: spreadsheets, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/csv-query
What's inside
- Skill name
csv-query- Description
- Run SQL queries against CSV/TSV/Excel files using Polars SQL engine
- License
- Apache-2.0
- Metadata
- category: data
- Instructions
- 102 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- allowed-tools: must be a space-separated string
Files (2)
- LICENSE
- SKILL.md
SKILL.md (first lines)
# CSV Query
Query tabular data files using SQL via the Polars-powered `sqlp` command.
> **Cowork note:** If relative paths don't resolve, call `mcp__qsv__qsv_get_working_dir` and `mcp__qsv__qsv_set_working_dir` to sync the working directory.
## Decision Tree
**Is the query simple (single column filter, basic select)?**
- Yes -> Consider `select` + `search` for simpler operations
- No -> Use `sqlp` for full SQL support
**Does the query involve joins, GROUP BY, window functions, or complex expressions?**
- Yes -> Use `sqlp` (Polars SQL engine)
**Is the CSV file very large (> 10MB)?**
- Yes -> Consider converting to Parquet with `mcp__qsv__qsv_to_parquet` for faster repeated queries. Note: `sqlp` can also query CSV files of any size directly.
## Steps
1. **Prepare the file**: Run `mcp__qsv__qsv_index` and `mcp__qsv__qsv_stats` with `cardinality: true, stats_jsonl: true` to create index and stats cache.
2. **Read the stats cache**: Read `<FILESTEM>.stats.csv` (e.g., `data.stats.csv` for `data.csv`) to understand column metadata before writing SQL. This is the most important step for writing efficient queries.
3. **Run frequency on key columns**: For columns you plan to GROUP BY, filter on, or join on, run `mcp__qsv__qsv_frequency` to see actual value distributions. This reveals the best filter values and whether a GROUP BY will produce a manageable result set.
4. **Write and run SQL**: Use `mcp__qsv__qsv_sqlp` with the SQL query informed by stats and frequency data. The table name in SQL is the filename stem (e.g., `data.csv` -> `SELECT * FROM data`). For Parquet files, use `read_parquet('data.parquet')` as the table source instead.
5. **Refine if needed**: Check results and adjust the query.
## Using Stats to Write Better SQL
After reading the `.stats.csv` cache, use these columns to inform your SQL:
| Stats Column | How to Use in SQL |
|-------------|-------------------|
| `type` | Use correct casts and comparisons — don't quote integers, use date functions for Date/DateTime columns |
| `min` / `max` | Write precise WHERE clauses using actual data range (e.g., `WHERE price BETWEEN 10.5 AND 999.99` instead of arbitrary bounds) |
| `cardinality` | Estimate GROUP BY result size — low cardinality (< 100) is fast; high cardinality (> 10K) may need LIMIT or a different approach |
| `nullcount` | Only add COALESCE or IS NOT NULL where `nullcount` > 0 — skip null handling for columns with zero nulls |
| `sort_order` | Skip ORDER BY if data is already sorted on that column (sort_order = "Ascending"/"Descending") |
| `mean` / `stddev` | Write outlier filters: `WHERE col BETWEEN mean - 3*stddev AND mean + 3*stddev` |
| `median` / `q1` / `q3` | For skewed data (when mean and median diverge), use quartile-based ranges: `WHERE col BETWEEN q1 AND q3` instead of mean ± stddev |
| `skewness` | If skewness > 1 or < -1, prefer median/quartile-based filters over mean-based ones |
| `cv` | High CV (> 100%) signals high relative variability — add LIMIT to GROUP BY queries and consider binning continuous values |
| `outliers_percentage` | If > 5%, consider excluding outliers before aggregation: `WHERE col BETWEEN lower_inner_fence AND upper_inner_fence` |
| `sparsity` | Columns with sparsity > 0.5 are mostly null — avoid using them as join keys or GROUP BY columns |
### Using Frequency for Filter Values
Run `mcp__qsv__qsv_frequency` with `select: "col", limit: 20` before writing WHERE clauses on categorical columns:
- **Pick selective filters**: If `frequency` shows "active" has 90% of rows, filtering on `WHERE status = 'active'` is wasteful — filter on the rare values instead
- **Validate expected values**: If you plan `WHERE category IN ('A','B','C')`, check frequency first to confirm those values exist and see if you're missing any
- **Avoid GROUP BY on high-cardinality columns**: If frequency shows thousands of unique values, GROUP BY will produce a huge result — add LIMIT or aggregate differently
## SQL Syntax Guide
The `sqlp` command uses Polars SQL dialect:
```sql
-- Basic select
SELECT col1, col2 FROM data WHERE col1 > 100
-- Aggregation
SELECT category, COUNT(*) as cnt, AVG(price) as avg_price
FROM data GROUP BY category ORDER BY cnt DESC
-- Window functions
SELECT *, ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) as rank
FROM employees
-- String operations
SELECT * FROM data WHERE col1 LIKE '%pattern%'
-- Date operations
SELECT *, EXTRACT(YEAR FROM date_col) as year FROM data
-- Multiple files (join)
SELECT a.*, b.name FROM file1 a JOIN file2 b ON a.id = b.id
-- CASE expressions
SELECT *, CASE WHEN amount > 1000 THEN 'high' ELSE 'low' END as tier FROM data
```
## Table Naming Convention
- File: `sales_2024.csv` -> Table: `sales_2024`
- File: `my-data.csv` -> Table: `"my-data"` (quote if contains special chars)
- Multiple files: each file is a separate table
## Notes
- `sqlp` uses the Polars engine - some PostgreSQL-specific syntax may not be supported
- For very complex queries that fail, suggest DuckDB as an alternative
- The stats cache helps Polars choose optimal data types for columns
- Results go to stdout by default; use `--output file.csv` for large result sets
- Column names are case-sensitive in SQL queries
- Use `LIMIT` to preview large result sets before running full queries
- `sqlp` can query multiple CSV files in a single SQL statement (useful for joins)From Kilo-Org/kilo-marketplace, Apache-2.0.
More from Kilo-Org/kilo-marketplace
- 0.795score
dynamic-tables-tutorial
Snowflake
Interactive tutorial that teaches Snowflake Dynamic Tables hands-on.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
cortex-code
Snowflake Integration Team
Routes Snowflake-related operations to Cortex Code CLI for specialized Snowflake expertise.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
dbt-analytics-engineering
dbt-labs
Builds and modifies dbt models, writes SQL transformations using ref() and source(), creates tests, and validates results with dbt show.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
database-redshift
christopher huffman
Amazon Redshift expert.
SkillAFreshness: A★ 195Claude Code +9 - 0.791score
jupyter-notebook
Kilo
Use whenever the user works with Jupyter notebooks (`.ipynb`), including creating, inspecting, editing, executing, or visualizing notebook content for…
SkillAFreshness: A★ 195Claude Code +9 - 0.791score
gcp-event-driven-architecture-review
github: Raishin
Review GCP Pub/Sub, Eventarc, Cloud Tasks, Cloud Scheduler, and Workflows designs — dead-letter topics, message ordering, idempotency, fan-out blast radius…
SkillAFreshness: A★ 195Claude Code +9 - 0.789score
dbt
dbt-labs
Skills for analytics engineering with dbt - building models, writing tests, querying the semantic layer, troubleshooting jobs, and more.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
data-investigation
Pedro / Kilo Code
A workflow for conducting rigorous, reproducible data investigations and ad-hoc analyses.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
apache-arrow
terminal-skills
Expert guidance for Apache Arrow, the cross-language columnar memory format for analytics workloads.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
dagster
terminal-skills
Dagster is a data pipeline orchestrator built around the concept of software-defined assets.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
cassandra
terminal-skills
Apache Cassandra is a distributed NoSQL database designed for high availability and linear scalability.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
prefect
terminal-skills
Prefect is a modern workflow orchestration framework for Python data pipelines.
SkillAFreshness: A★ 195Claude Code +9
Signals
- Stars
- 195
- Forks
- 328
- Open issues
- 18
- Last commit (this folder)
- Jun 24, 2026 (4 months ago)
- Last release
- Sep 28, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/Kilo-Org/kilo-marketplace
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Kilo-Org
- 0.661score
angular-tooling
Kilo-Org
Use Angular CLI and development tools effectively in Angular v20+ projects.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
angular-http
Kilo-Org
Implement HTTP data fetching in Angular v20+ using resource(), httpResource(), and HttpClient.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
elasticsearch-file-ingest
Kilo-Org
Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
senior-data-engineer
Kilo-Org
Data engineering skill for building scalable data pipelines, ETL/ELT systems, and data infrastructure.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
sql-server-table-reconciliation
Kilo-Org
Use when: comparing SQL Server tables across instances, data migration validation, ETL verification, row mismatch detection, schema drift, reconciliation…
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
dataset-transformation
Kilo-Org
Generates code that transforms datasets between ML schemas for model training or evaluation.
SkillAFreshness: A★ 195Claude Code +9
Cite this page
csv-query skill. Agent Mart. https://agentmart.dev/skills/kilo-org-csv-query (last updated 2026-10-24)