Apply a natural language transformation description to a CSV file and produce a new CSV.
When to Use
Non-technical users need to reshape data
Quick ETL without writing pandas code
Inputs
Name
Type
Required
Description
input_path
string
yes
Path to source CSV
instruction
string
yes
e.g. "Filter rows where sales > 1000, keep only name and sales columns"
output_path
string
no
Where to save result
Example
import pandas as pd
def csv_transform(input_path: str, instruction: str, output_path: str = None) -> pd.DataFrame:
'''
Parse simple filter/select instructions without LLM for offline demo.
For production, pass instruction to an LLM that writes pandas code.
'''
df = pd.read_csv(input_path)
# Example: "filter rows where sales > 1000"
if "filter" in instruction.lower() and ">" in instruction:
import re
m = re.search(r"(\w+)\s*>\s*([\d.]+)", instruction)
if m:
col, val = m.group(1), float(m.group(2))
if col in df.columns:
df = df[df[col] > val]
# Example: "keep only name and sales columns"
if "keep only" in instruction.lower():
cols = [c.strip() for c in instruction.lower().split("keep only")[-1].split("and")]
cols = [c.replace("columns", "").strip() for c in cols]
valid_cols = [c for c in cols if c in df.columns]
if valid_cols:
df = df[valid_cols]
if output_path:
df.to_csv(output_path, index=False)
return df
1---2name: csv-transform3description: CSV Transform4---56# CSV Transform78## Description910Apply a natural language transformation description to a CSV file and produce a new CSV.1112## When to Use1314- Non-technical users need to reshape data15- Quick ETL without writing pandas code1617## Inputs1819| Name | Type | Required | Description |20|------|------|---------|-------------|21| input_path | string | yes | Path to source CSV |22| instruction | string | yes | e.g. "Filter rows where sales > 1000, keep only name and sales columns" |23| output_path | string | no | Where to save result |2425## Example2627```python28import pandas as pd2930def csv_transform(input_path: str, instruction: str, output_path: str = None) -> pd.DataFrame:31 '''32 Parse simple filter/select instructions without LLM for offline demo.33 For production, pass instruction to an LLM that writes pandas code.34 '''35 df = pd.read_csv(input_path)36 # Example: "filter rows where sales > 1000"37 if "filter" in instruction.lower() and ">" in instruction:38 import re39 m = re.search(r"(\w+)\s*>\s*([\d.]+)", instruction)40 if m:41 col, val = m.group(1), float(m.group(2))42 if col in df.columns:43 df = df[df[col] > val]44 # Example: "keep only name and sales columns"45 if "keep only" in instruction.lower():46 cols = [c.strip() for c in instruction.lower().split("keep only")[-1].split("and")]47 cols = [c.replace("columns", "").strip() for c in cols]48 valid_cols = [c for c in cols if c in df.columns]49 if valid_cols:50 df = df[valid_cols]51 if output_path:52 df.to_csv(output_path, index=False)53 return df54```
Run npx skillmds@latest add ashish993/csv-transform in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
CSV Transform It is listed under Data & Analytics on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ashish993 (@ashish993) published this skill. Their other Agent Skills are listed on their SkillMD profile.