csv-wrangling

Provides standard workflow sequences, a tool-selection matrix, and compositional patterns for qsv CSV data processing.

Last repository push
GitHub Stars
212
Forks
664
Issues / PRs
21

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "csv-wrangling" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-2a300923c9cdbdb855ae0904ce80681988cbccb66a547dd4d8c88dd04bf3333f. Verify the upstream source and version against https://github.com/Kilo-Org/kilo-marketplace before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Provides standard workflow sequences, a tool-selection matrix, and compositional patterns for qsv CSV data processing.

0 Downloads

Introduction source: third_party · Kilo-Org · 0.0.1 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: csv-wrangling
description: >-
  Standard workflow order, tool selection matrix, and composition patterns for
  qsv CSV data wrangling
metadata:
  category: data
  source:
    repository: 'https://github.com/dathere/qsv'
    path: .claude/skills/skills/csv-wrangling
    license_path: COPYING
    commit: d7bcd2d9ac92ca2edcc6086a1132ea2beb6ab079

CSV Wrangling with qsv

Standard Workflow Order

Always follow this sequence when processing CSV data:

  1. Setup (Cowork) - If relative paths don't resolve, call mcp__qsv__qsv_get_working_dir and mcp__qsv__qsv_set_working_dir to sync
  2. Index - index (enables fast random access for subsequent commands)
  3. Discover - sniff (detect format, encoding, delimiter) -> headers -> count
  4. Profile - stats --cardinality --stats-jsonl (creates cache used by smart commands)
  5. Inspect - slice --len 5 (preview rows), frequency --frequency-jsonl (value distributions with cache for reuse)
  6. Transform - select, sort, dedup, rename, replace, search, sqlp, etc.
  7. Validate - validate (against JSON Schema), stats (verify results)
  8. Export - tojsonl, table, mcp__qsv__qsv_to_parquet, to (xlsx/sqlite/postgres/ods/datapackage)
  9. Document - describegpt --all (AI-generated Data Dictionary, Description & Tags)

Tool Selection Matrix

Task Best Tool Alternative When to Use Alternative
Select columns select sqlp Need computed columns
Filter rows search sqlp Complex WHERE conditions
Sort data sort sqlp Need ORDER BY with LIMIT
Remove duplicates dedup sqlp Need GROUP BY dedup
Join two files joinp join join for memory-constrained
Aggregate/GROUP BY sqlp frequency frequency for simple counts; --frequency-jsonl creates cache
Column stats stats moarstats moarstats for extended stats
Find/replace replace sqlp sqlp for conditional replace
Reshape wide->long transpose --long - DuckDB UNPIVOT (external) for complex reshaping
Reshape long->wide pivotp sqlp Complex pivots
Concatenate files cat rows cat rowskey Different column orders
Sample rows sample slice slice for positional ranges
Document dataset describegpt — AI-generated Data Dictionary, Description & Tags

qsv Selection Syntax

Used by select, search, sort, dedup, frequency, and other commands:

Syntax Meaning Example
name Column by name select "City"
1 Column by 1-based index select 1
1,3,5 Multiple columns select 1,3,5
1-5 Range (inclusive) select 1-5
!col Exclude column select '!SSN'
!1-3 Exclude range select '!1-3'
/regex/ Match column names select '/^price/'

Common Pipeline Patterns

Clean and Deduplicate

sniff -> index -> safenames -> fixlengths -> sqlp (TRIM) -> dedup -> validate

Profile and Analyze

sniff -> index -> stats --cardinality --stats-jsonl -> read .stats.csv -> frequency (on key columns) -> sqlp (GROUP BY queries)

Before writing SQL: read .stats.csv to learn column types, cardinality, nullcount, min/max, sort order. Run frequency on columns you'll GROUP BY or filter on. Use this to write precise WHERE clauses, correct type casts, and avoid unnecessary COALESCE.

For repeated SQL queries on large CSV (> 10MB), consider converting to Parquet: sniff -> index -> stats -> to_parquet -> sqlp (using read_parquet()). Note: sqlp can query CSV of any size directly.

Join and Enrich

index (both files) -> stats (both) -> joinp -> select (keep needed columns) -> sort

Profile and Document

sniff -> index -> stats --cardinality --stats-jsonl -> describegpt --all

Convert and Export

excel (to CSV) -> index -> stats -> select -> tojsonl / qsv_to_parquet

Batch Convert to Multiple Formats

excel (to CSV) -> index -> stats -> to xlsx report.xlsx
excel (to CSV) -> index -> stats -> to sqlite report.db
excel (to CSV) -> index -> stats -> to parquet parquet_output_dir

File Integrity Verification

blake3 file.csv > checksums.b3 (before transfer) -> blake3 --check checksums.b3 (after transfer)

Delimiter Handling

  • CSV (,): default, no flag needed
  • TSV (\t): use --delimiter '\t' or file extension .tsv
  • SSV (;): use --delimiter ';' or file extension .ssv
  • Auto-detect: set QSV_SNIFF_DELIMITER=1 environment variable

Important Notes

  • Column indices are 1-based, not 0-based
  • --no-headers flag changes behavior significantly - most commands assume headers exist
  • Output goes to stdout by default; use --output file.csv to write to file
  • Many commands auto-detect .sz (Snappy compressed) files transparently
  • cat rows requires same column order; use cat rowskey for different schemas
  • dedup loads all data into memory and sorts internally; use --sorted flag if input is already sorted to enable streaming mode with constant memory
  • sort loads entire file into memory; for huge files use sqlp with ORDER BY
  • For repeated SQL queries on large CSV (> 10MB), consider converting to Parquet with mcp__qsv__qsv_to_parquet for faster performance. Parquet works ONLY with sqlp and DuckDB — all other qsv commands need CSV/TSV/SSV input

Tool Discovery

Use mcp__qsv__qsv_search_tools to discover commands beyond the initially loaded core tools. There are 55 qsv skill-based commands covering selection, filtering, transformation, aggregation, joining, validation, formatting, conversion, and more.

Operational Notes

  • Timeout: Default operation timeout is 10 minutes (configurable via QSV_MCP_OPERATION_TIMEOUT_MS, max 30 min). Allow operations to run to completion.
  • Memory: dedup, sort, reverse, table, transpose, pragmastat, and stats (with extended stats) load entire files into memory. For files >1GB, prefer extdedup/extsort via mcp__qsv__qsv_command.
  • Cowork path architecture: qsv runs on the HOST machine. File paths must be valid on the host. Always verify with mcp__qsv__qsv_get_working_dir.
  • Sequential operations: Prefer sequential over parallel qsv calls to avoid queuing delays: index → stats → analysis.
  • Large files (>5GB): Let mcp__qsv__qsv_frequency run to completion. Only fall back to mcp__qsv__qsv_sqlp with GROUP BY if the server timeout is exceeded.
  • Context window: Save outputs to files rather than returning to chat. Use mcp__qsv__qsv_slice or mcp__qsv__qsv_sqlp with LIMIT to inspect subsets.

Version history

  1. skills-20261103210927-6c1b454 GitHub ↗
    Original release notes

    Automated skills release from commit 6c1b4543cac1d45a80bf5904e4b69ac315117323

  2. skills-20260928190452-ff51758 GitHub ↗
    Original release notes

    Automated skills release from commit ff51758b06b8249007116184096765d47bdb7505

  3. skills-20260924105536-d31110d GitHub ↗
    Original release notes

    Automated skills release from commit d31110d62dc0bd00c22f1d6f6a630d1e702a0049

  4. skills-20260923085113-cea285e GitHub ↗
    Original release notes

    Automated skills release from commit cea285ef0e4d6ec47cd2fd9fdbca03813a3363c7

  5. skills-20260922193956-97d7333 GitHub ↗
    Original release notes

    Automated skills release from commit 97d7333d8200e5ac556c659c8669f3a83ba10866

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value88/100

Highlights

  • 提供完整的 qsv CSV 数据处理标准工作流程,覆盖从索引、探测、分析到导出、文档化的全流程
  • 包含详细的工具选择矩阵和常见管道模式,具有明确的实用价值和广泛受众
Trigger Precision95/100

Highlights

  • description 明确描述了 Skill 的核心功能,触发词精准完整,边界清晰
Structure and Standards92/100

Highlights

  • 文档结构清晰,章节划分合理,包含多个端到端示例和详细说明
  • frontmatter 完整,单文件长度适中,易于理解执行流程
Execution Reliability90/100

Highlights

  • 工具来源明确,参数说明详细,覆盖了主要异常情况和最佳实践
  • 提供了替代方案和针对大文件、内存限制等场景的处理建议
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.