Percerno Skillsbeta
← everything it can do · sheets

Csv Query XLSX

Answer questions about a big CSV, Excel or Parquet file with SQL (DuckDB) in ONE command, instead of reading the rows into the conversation: describe a file (columns, types, row count, sample), totals and averages by group (sales by region and month), filter rows, join two files, run any SQL, and export the result as CSV, Excel or Parquet. Handles 100,000+ rows in seconds. Use for: what is in this file, total sales per region, top 10 customers, rows where amount > 1000, average per month, combine customers and orders, turn this question into a table. Triggers: CSV, large file, pivot, group by, sum by, average by, top N, filter rows, SQL, Parquet, how many rows, what columns.

4 uses this weeksource Percernolicence MIT
Quality gate: PASS · fewer tokens, same result · measured 2026-10-24
Same outcome with 0 % fewer tokens than reading the file into the model (2 requests).
2/2 requests answered with the skill doing the work, through the connector; direct run 3/3
Security scan: clean · 2026-10-24 · 2 files
no network calls, shell tricks, credential access or instruction tampering found in its files.

Try asking

Say it in your own words; the assistant finds this recipe by itself. Examples:

“Use the csv-query skill to …”
Try this skill from Claude, ChatGPT or a chat on your own page. Free plan, no credit card.Get started free

Details

When it is the right choice

Answer questions about a big CSV, Excel or Parquet file with SQL (DuckDB) in ONE command, instead of reading the rows into the conversation: describe a file (columns, types, row count, sample), totals and averages by group (sales by region and month), filter rows, join two files, run any SQL, and export the result as CSV, Excel or Parquet. Handles 100,000+ rows in seconds. Use for: what is in this file, total sales per region, top 10 customers, rows where amount > 1000, average per month, combine customers and orders, turn this question into a table. Triggers: CSV, large file, pivot, group by, sum by, average by, top N, filter rows, SQL, Parquet, how many rows, what columns.

The full recipe the assistant reads

CSV query (one command, DuckDB)

python3 /skills/csv-query/scripts/query.py <verb> … — inputs in /work/in (.csv, .tsv, .parquet, .xlsx), results in /work/out as .csv, .xlsx, .parquet or .md (a Markdown table for small results you want to show). Every verb prints one OK … line, or ERROR … with the SQL error.

Need Command
What is in the file query.py describe /work/in/sales.csv (columns, types, rows, 5 sample rows)
Totals by group query.py summary /work/in/sales.csv /work/out/by-region.xlsx --by region --agg units:sum,price:avg,*:count
By two columns, sorted query.py summary /work/in/sales.csv /work/out/by-month.csv --by region,"strftime(date,'%Y-%m') AS month" --agg units:sum --order "units_sum DESC"
Filter rows query.py filter /work/in/sales.csv /work/out/dk-large.csv --where "region = 'DK' AND units >= 20" [--limit 1000]
Join two files query.py join /work/out/joined.csv /work/in/sales.csv /work/in/products.csv --on product [--how left|inner]
Any SQL (file is table t, second file u) query.py sql /work/in/sales.csv /work/out/top.md --query "SELECT product, SUM(units*price) AS revenue FROM t GROUP BY 1 ORDER BY 2 DESC LIMIT 10"
Two files in SQL add --second /work/in/products.csv and use u
  • Aggregates: sum, avg, count, min, max, median, count_distinct; *:count counts rows. Result columns are named <col>_<agg> (units_sum).
  • Dates and numbers are detected automatically; column names with spaces go in double quotes.
  • Start with describe; then write the smallest query that answers the question and show the person the OK line plus the table (.md) or the download link.
Files in this skill (3)
  • SKILL.md
  • scripts/__pycache__/query.cpython-311.pyc
  • scripts/query.py
Where it comes from

Written by Percerno, MIT licence.