name: csv-data-explorer description: Explore, filter, summarize, and visualize CSV data directly in terminal with interactive queries. version: 1.0.0 author: skill-factory metadata: openclaw: requires: bins: - python3 python: - pandas - matplotlib
A CLI tool to explore, analyze, and visualize CSV data directly from the terminal. Load CSV files, filter rows, calculate statistics, generate summaries, and create basic visualizations without leaving your terminal.
Key features: - Load and preview CSV files with automatic delimiter detection - Explore data structure - view columns, data types, missing values - Filter rows based on conditions (equality, inequality, contains, regex) - Select columns - include/exclude specific columns - Calculate statistics - mean, median, min, max, standard deviation, percentiles - Generate summaries - count, unique values, frequency distributions - Basic visualizations - histograms, bar charts, scatter plots (ASCII or simple terminal output) - Export results - filtered data, statistics, summaries to new CSV/JSON files - Interactive mode - step-by-step exploration with prompts - Command-line mode - scriptable operations for automation
更多技能请访问小葱技能站7w4.net。
Basic commands:
# Load and preview a CSV file
python3 scripts/main.py preview data.csv
# Show basic statistics
python3 scripts/main.py stats data.csv
# Filter rows where column 'age' > 30
python3 scripts/main.py filter data.csv --where "age > 30"
# Select specific columns
python3 scripts/main.py select data.csv --columns name,age,salary
# Generate histogram for a column
python3 scripts/main.py histogram data.csv --column age --bins 10
# Count unique values in a column
python3 scripts/main.py unique data.csv --column category
# Export filtered data
python3 scripts/main.py filter data.csv --where "salary > 50000" --output filtered.csv
# Interactive exploration mode
python3 scripts/main.py interactive data.csv
python3 scripts/main.py preview sales.csv --limit 10
Output:
CSV File: sales.csv (1000 rows × 5 columns)
First 10 rows:
┌─────┬────────────┬───────────┬────────┬───────────┐
│ Row │ Date │ Product │ Amount │ Region │
├─────┼────────────┼───────────┼────────┼───────────┤
│ 1 │ 2024-01-01 │ Widget A │ 150.50 │ North │
│ 2 │ 2024-01-01 │ Widget B │ 89.99 │ South │
│ ... │ ... │ ... │ ... │ ... │
└─────┴────────────┴───────────┴────────┴───────────┘
Column summary:
- Date: 1000 non-null, type: datetime
- Product: 1000 non-null, type: string (5 unique values)
- Amount: 1000 non-null, type: float (min: 10.00, max: 999.99)
- Region: 1000 non-null, type: string (4 unique values)
python3 scripts/main.py filter sales.csv --where "Region == 'North' and Amount > 100" --stats
Output:
Filtered data: 237 rows (from 1000 total)
Statistics for filtered data:
- Count: 237
- Mean Amount: 245.67
- Median Amount: 210.50
- Min Amount: 101.00
- Max Amount: 999.99
- Standard Deviation: 145.23
python3 scripts/main.py histogram sales.csv --column Amount --bins 5
Output (ASCII approximation):
Amount Distribution (5 bins):
[10.00 - 207.99] ████████████████████████████ 312
[208.00 - 405.99] ████████████████████ 241
[406.00 - 603.99] ██████████ 152
[604.00 - 801.99] █████ 78
[802.00 - 999.99] ███ 45
python3 scripts/main.py interactive sales.csv
Interactive mode guides you through: 1. File loading and preview 2. Column selection and filtering 3. Statistical analysis 4. Visualization options 5. Export results
pandas library for data manipulation (installed automatically or via pip)matplotlib library for visualizations (optional, for enhanced charts)Install missing dependencies:
pip3 install pandas matplotlib
The tool works with CSV files in the current directory or specified paths. No special configuration directories are required.
This is a skill built by the Skill Factory. Issues and improvements should be reported through the OpenClaw project.
这个 CSV 数据探索工具功能比较丰富,能满足基本的文件预览、数据统计、筛选过滤和简单可视化需求。文档说明详细,小白也能快速上手使用。主要缺点是运行稳定性一般,遇到格式特殊的 CSV 文件或异常数据时可能出错,另外大文件处理性能也有限。如果只是偶尔处理小规模 CSV 数据,这个工具足够用,但不适合处理重要或大型数据集。