@toolpal/csv-insights
publicv2.0published 1 download this weekMIT
Profiles a CSV file locally and exactly instead of eyeballing it: row count, each column's inferred type (number, date, boolean, text), missing and unique values, min/max/mean/median/sum/standard deviation for numeric columns, date ranges, and the most frequent values of text columns. Handles quoted fields and comma, semicolon, tab or pipe delimiters. Offline, no API key needed.
# @toolpal/csv-insights
Profiles a CSV or TSV file locally with exact calculations — no API keys, no network access, and no row sampling guesses.
## How it works
1. Detects the delimiter (`,`, `;`, tab, or `|`) from the header row unless you specify one.
2. Parses quoted RFC 4180 fields, counts data rows and ragged rows, and deduplicates header names.
3. For each column, infers its type (`number`, `date`, `boolean`, `text`, or `empty`), counts filled/missing/unique values, and computes:
- **Numeric columns:** min, max, mean, median, sum, and standard deviation (handling currency prefixes, accounting negatives like `($42.50)`, percentages, and European decimal commas on `;`-delimited files).
- **Date columns:** earliest and latest ISO dates.
- **Text & boolean columns:** the most frequent values and their counts.
## Example
```json
{
"file": "sales-q3.csv",
"topValues": 5
}
```
Returns (illustrative):
```json
{
"rows": 1420,
"columnCount": 4,
"delimiter": ",",
"raggedRows": 0,
"columns": [
{
"name": "revenue",
"type": "number",
"filled": 1418,
"missing": 2,
"unique": 891,
"stats": { "min": 12.5, "max": 9800, "mean": 412.35, "median": 250, "sum": 584712.3, "stdDev": 620.11 }
}
]
}
```
## Notes
- Runs 100% offline (`net: false`, no environment variables required).
- Maximum input file size: 25 MB.
- Empty cells as well as `NA`, `N/A`, `null`, `none`, `NaN`, and `-` are counted as missing.