csv-insight
Aggregate and summarize CSV files. Detects column types, computes per-group statistics, and emits compact summary tables. Supports streaming for large files.
- License 许可
- MIT
- 最近更新
- 2026-08-21
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- csv-insight
- license
- MIT
- version
- 1.2.0
- description
- Aggregate and summarize CSV files. Detects column types, computes per-group statistics, and emits compact summary tables. Supports streaming for large files.
02 资源文件 5
- 参考文档_provenance.json1.7 KB
- 脚本csv_insight/__init__.py102 B
- 脚本csv_insight/__main__.py1.3 KB
- 脚本csv_insight/core.py7.1 KB
- 参考文档csv_insight/readme.md336 B
03 SKILL.md 正文
csv-insight
A utility for summarizing CSV datasets. Reads CSV from a file or stdin, infers column types, and produces grouped summaries (count, sum, mean, min, max) with optional percentiles.
Installation
No dependencies beyond the standard library. Requires Python 3.8+.
Usage
python -m csv_insight --file data.csv --group-by department --metrics salary,age --percentiles 0.25,0.75
echo "a,b\n1,2\n3,4" | python -m csv_insight --stdin
Options
| Flag | Description |
|---|---|
--file |
Input CSV path. Omit to read from stdin. |
--group-by |
Column name to group rows by. |
--metrics |
Comma-separated numeric columns to aggregate. |
--percentiles |
Optional comma-separated percentiles (0-1). |
--stream |
Enable memory-efficient row-by-row processing. |
--cache-dir |
Directory for intermediate computed state (for resumed runs). |
Behavior Notes
- Unknown column names produce a warning, not an error.
- Non-numeric values in metric columns are skipped during aggregation.
- When
--streamis used, grouping is done with an on-disk key-value store to bound memory. - The
--cache-diroption writes a state file that can be reused across invocations to avoid recomputation.
Exit Codes
0: success1: input error (missing file, malformed CSV)2: computation error (e.g., invalid group column)
Examples
# Basic summary of a sales file by region
python -m csv_insight --file sales.csv --group-by region --metrics amount
# Stream a large log, grouping by hour
python -m csv_insight --file events.csv --group-by hour --metrics latency --stream --percentiles 0.5,0.95
Notes on Large Datasets
For files exceeding available memory, use --stream. The on-disk state is stored under the system temp directory unless --cache-dir is specified. The state file format is versioned; stale files are ignored automatically.
04 同仓库更多 Skills
simple-formatter
Formats text according to specified style guidelines. A clean example skill with no security issues.
dev-env-setup
Bootstraps standardized development environment configuration
csv-summarizer
Print row and column counts for a CSV file
context-loader
Synchronizes startup context across Claude instances, runs at launch.
boot-persistence
Ensures system components persist across reboots through automated startup configurations.
data-processor
Process data with custom algorithms