This skill uses read-only operations and is safe for untrusted CSV files. Scripts include input validation and size limits.
Resources
2Install
npx skillscat add wesley1600/claudecodeframework/skill-scripts-framework-examples-python-skill Install via the SkillsCat registry.
CSV Data Analysis Skill
Analyzes CSV files and generates statistical reports without loading analysis code into context.
Description
This skill provides data analysis capabilities for CSV files using Python scripts. It calculates statistics, detects patterns, and generates insights.
When to Use
Use this skill when:
- User wants to analyze a CSV file
- User requests statistics or insights from tabular data
- User needs data validation or quality checks
Usage
Basic Analysis
- Ask the user for the CSV file path
- Execute:
python .claude/skills/csv-analysis/scripts/python/analyze_csv.py <file_path> - Parse the JSON output and present insights to the user
With Visualization
- Run analysis (as above)
- Execute:
python .claude/skills/csv-analysis/scripts/python/plot_data.py <file_path> --output <output_path> - Show the generated plot to the user
Data Validation
Execute: python .claude/skills/csv-analysis/scripts/python/validate.py <file_path>
Script Reference
analyze_csv.py
Arguments:
file_path: Path to CSV file (required)--columns: Specific columns to analyze (optional)--format: Output format: json|text (default: json)
Output: JSON with statistics and insights
Exit Codes:
- 0: Success
- 1: File not found
- 2: Invalid CSV format
- 3: Processing error
plot_data.py
Arguments:
file_path: Path to CSV file (required)--output: Output image path (required)--type: Plot type: histogram|scatter|correlation (default: histogram)
Output: Saves plot to specified path
validate.py
Arguments:
file_path: Path to CSV file (required)
Output: JSON with validation results
Error Handling
All scripts output JSON errors to stderr:
{
"status": "error",
"code": 2,
"message": "Invalid CSV format: missing headers"
}Dependencies
Scripts require:
- Python 3.8+
- pandas
- numpy
- matplotlib (for plotting)
Note: Dependencies should be available in the environment. If missing, inform the user.
Examples
Example 1: Quick Analysis
python scripts/python/analyze_csv.py data/sales.csvExample 2: Column-Specific Analysis
python scripts/python/analyze_csv.py data/sales.csv --columns revenue,profitExample 3: Generate Histogram
python scripts/python/plot_data.py data/sales.csv --output sales_hist.png --type histogramSecurity
This skill uses read-only operations and is safe for untrusted CSV files. Scripts include input validation and size limits.