Skip to main content

Polars minimal data profiler.

Project description

Data Quality Profiler

Overview

The dq package provides an efficient and scalable way to perform data profiling using the Polars library. It analyzes datasets to generate various statistical summaries and insights, helping users understand the structure and quality of their data.

Features

  • Supports a variety of data types, including numeric, string, and datetime.
  • Computes key statistical metrics such as mean, median, standard deviation, and percentiles.
  • Detects missing values, empty fields, and string token distributions.
  • Provides both a Python and a command-line interface (CLI) for easy usage.

Installation

pip install dq

Usage

Python Example

from pathlib import Path
from pprint import pprint
import polars as pl
from dq import Profiler

if __name__ == "__main__":
    datafile_path = Path(__file__).resolve().parent / "data.csv"
    data: pl.DataFrame = pl.read_csv(datafile_path, separator=";")
    results = Profiler().run_profiling(data)
    pprint(results)

CLI Example

#!/bin/bash

DATA_PATH="$(pwd)/data.csv"
SCHEMA='{"comment": "String", "dob": "Date", "sales": "Float32"}'
LOADER_KWARGS='{"separator":";"}'
FORMATTER='json'

dq --path "$DATA_PATH" --schema="$SCHEMA" --kwargs="$LOADER_KWARGS" --format="$FORMATTER"

Supported Data Types

The package supports the following Polars data types:

  • Numeric: Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, Decimal
  • String: String, Categorical
  • Date/Time: Date, Datetime
  • Others: Boolean

Metrics Computed

  • String Profile: Minimum/maximum/average string length, token counts, empty or whitespace count.
  • Numeric Profile: Mean, median, standard deviation, min/max values, and percentiles.
  • Date/Datetime Profile: Minimum and maximum values.
  • Base Profile: Null values count.

License

MIT License

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

plmdp-0.1.0.dev0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

plmdp-0.1.0.dev0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file plmdp-0.1.0.dev0.tar.gz.

File metadata

  • Download URL: plmdp-0.1.0.dev0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.1

File hashes

Hashes for plmdp-0.1.0.dev0.tar.gz
Algorithm Hash digest
SHA256 9b5d33e5d8e22a4d430543cf0479a611e6679cd1226ad10e86c0b429d9fc486d
MD5 cd3008799d30f2817a6c5131a38dcc3b
BLAKE2b-256 b4c12404f6446cb94d31242a2c2dea8d6e263b0bef43725db7fe5c5d71357142

See more details on using hashes here.

File details

Details for the file plmdp-0.1.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: plmdp-0.1.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.1

File hashes

Hashes for plmdp-0.1.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 2534b5fdd56853716c8e32e4a25a300db33f322a53096e3fef313f32241309fd
MD5 086c7bdc179ce786a4d374ae38d81e0a
BLAKE2b-256 996043ac05fd910b8064f73c4b2e1b31cba9582caa1a4a782a67829b76792ef9

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