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
pytestunit 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csvstat_py-0.1.3.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csvstat_py-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / csvstat_py-0.1.3.tar.gz
| Download URL | csvstat_py-0.1.3.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7290d088873ca104118717e292c448192331f854809698470febeb575112f23e
|
|
BLAKE2b-256 checksum How to use checksums |
3ec7cbe4265656d2a19415ae5eeb6bfaa53fccf9faf7cf24d3835e1fc87a36fd
|
| 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.3-py3-none-any.whl
| Download URL | csvstat_py-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35145ceae8be38df2dcd077da5b12c1b819099ea2c71038752c5e9d8f6fa65bf
|
|
BLAKE2b-256 checksum How to use checksums |
1a8a1dae47b80d30e81aa19741104b7567b1d8bdfd49e61d2a35f2dcdebc9622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|