Skip to main content

A tool for analyzing and describing CSV files

Project description

DescribeCSV

A Python tool for analyzing and describing CSV files. It provides detailed information about file structure, data types, missing values, and statistical summaries. Perfect for initial data exploration and quality assessment of large CSV files.

Features

  • Automatic encoding detection and handling
  • Memory-efficient processing of large files through chunking
  • Comprehensive column analysis including:
    • Data types and structure
    • Missing value detection and statistics
    • Unique value counts and distributions
    • Statistical summaries for numeric columns
    • Most frequent values for categorical columns
  • Smart detection of numeric data stored as strings
  • Duplicate row detection and counting
  • Detailed file metadata information

Installation

You can install describecsv using pip:

pip install describecsv

Or using uv for faster installation:

uv pip install describecsv

Usage

From the command line:

describecsv path/to/your/file.csv

This will create a JSON file named your_file_details.json in the same directory as your CSV file.

Output Example

The tool generates a detailed JSON report. Here's a sample of what you'll get:

{
  "basic_info": {
    "file_info": {
      "file_name": "example.csv",
      "size_mb": 125.4,
      "created_date": "2024-02-21T10:30:00",
      "encoding": "utf-8"
    },
    "num_rows": 100000,
    "num_columns": 15,
    "missing_cells": 1234,
    "missing_percentage": 0.82,
    "duplicate_rows": 42,
    "duplicate_percentage": 0.042
  },
  "column_analysis": {
    "age": {
      "data_type": "int64",
      "unique_value_count": 75,
      "missing_value_count": 12,
      "mean_value": 34.5,
      "std_dev": 12.8,
      "min_value": 18.0,
      "max_value": 99.0
    },
    "category": {
      "data_type": "object",
      "unique_value_count": 5,
      "missing_value_count": 0,
      "top_3_values": {
        "A": 45000,
        "B": 30000,
        "C": 25000
      },
      "optimization_suggestion": "Consider using category dtype"
    }
  }
}

Features in Detail

Encoding Detection

  • Automatically detects file encoding
  • Handles common encodings (UTF-8, Latin-1, etc.)
  • Provides fallback options for difficult files

Memory Efficiency

  • Processes files in chunks
  • Optimizes data types automatically
  • Suitable for large CSV files

Data Quality Checks

  • Identifies potential data type mismatches
  • Suggests optimizations for categorical columns
  • Reports duplicate rows and missing values

Statistical Analysis

  • Comprehensive numeric column statistics
  • Frequency analysis for categorical data
  • Missing value patterns

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

describecsv-0.1.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

describecsv-0.1.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file describecsv-0.1.3.tar.gz.

File metadata

  • Download URL: describecsv-0.1.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for describecsv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f761179e5ec77d23e471c0daa84015fcfb832ea09f1d986905d5758f48d89fbf
MD5 d5e09915a1bcd1b21fad3170fa2a1796
BLAKE2b-256 bab9c48657966e7d8da86bfd5a7e8140ec73fbf8b2bc9086fdb9733cabd35335

See more details on using hashes here.

File details

Details for the file describecsv-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: describecsv-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for describecsv-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6439c731859fadb9fe57420062c90150610ce7a2a67be625b43be141259ed9a8
MD5 709ad34cb881bab8853dc3b0d3f8b0e3
BLAKE2b-256 b2368577283449d686f3096732e0ab311a92e8999dffdffc1ae3b9a65b399fbd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page