Skip to main content

csvstat

A lightweight command-line CSV data profiling tool built with Python.

Overview

csvstat is a command-line tool that analyzes CSV files and provides useful profiling information about the dataset, including column types, missing values, numerical statistics, and frequent values.

Features

  • Detects numeric, date, and text columns
  • Counts missing values
  • Calculates missing-value percentages
  • Calculates minimum, mean, and maximum for numeric columns
  • Displays the most frequent values in text columns
  • Supports configurable top-N values
  • Includes comprehensive pytest unit tests
  • Packaged using pyproject.toml

Installation

Clone the repository:

git clone https://github.com/palak200526/csvStat.git
cd csvStat

Install the package:

python -m pip install -e .

Usage

Basic Usage

Run csvstat with a CSV file:

csvstat tests/data/sample.csv

Top N Values

To display a different number of frequent values:

csvstat tests/data/sample.csv --top 3

Example Output

CSV file: tests/data/sample.csv
Rows: 10
Columns: 7

Age:
  Type: numeric
  Missing: 0
  Missing percentage: 0.00%
  Min: 22.0
  Mean: 28.20
  Max: 40.0

Salary:
  Type: numeric
  Missing: 0
  Missing percentage: 0.00%
  Min: 50000.0
  Mean: 67200.00
  Max: 95000.0

Testing

The project uses pytest for unit testing.

Run the complete test suite:

pytest

Expected result:

73 passed

Project Structure

csvStat/
├── src/
│   └── csvstat/
│       ├── __init__.py
│       ├── cli.py
│       └── profiler.py
├── tests/
│   ├── data/
│   │   └── sample.csv
│   ├── test_cli.py
│   └── test_profiler.py
├── pyproject.toml
├── README.md
├── LICENSE
└── .gitignore

Packaging

The project is configured as a Python package using pyproject.toml.

Install the package locally with:

python -m pip install -e .

After installation, the csvstat command can be used directly from the terminal:

csvstat tests/data/sample.csv

License

This project is licensed under the MIT License.

Release files for csvstat-py 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csvstat-py 0.1.0
File Size Uploaded
csvstat_py-0.1.0.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for csvstat-py 0.1.0
File Interpreter ABI Platform
csvstat_py-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / csvstat_py-0.1.0.tar.gz

Download URL csvstat_py-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8d8b526cbd4143feac743a7dbb8deb72c4e49684286c9b8fc09454dd587488f4
BLAKE2b-256 checksum
How to use checksums
c7315883fda1713215b077a1077e69820f3f5938d5dc5d500601a05b0e7837cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / csvstat_py-0.1.0-py3-none-any.whl

Download URL csvstat_py-0.1.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3c3a50f4cb409d9f01dd89160d2b2b87f30a36a9e009c5033ba914685d3f391
BLAKE2b-256 checksum
How to use checksums
5bf67aca3ba74ba8027ef9acaa69981ef532a0bffa488692290f8ad6c978bf7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page