Skip to main content

lightweight library that provides functionalities for common EDA tasks

Project description

Edazer

Edazer is a lightweight Python package for performing common exploratory data analysis (EDA) tasks. It provides quick and intuitive methods to inspect, summarize, and understand datasets—supporting both pandas and polars backends.

Includes utilities for: Interactive DataFrame exploration (via itables)

Automated profiling reports (via a wrapper around ydata-profiling)

Unique key detection (via get_primary_key)

🚀 Ideal for:

Jupyter notebooks

Fast, one-line data profiling

Early-stage dataset exploration


Features

  • Quick DataFrame Summaries: Instantly view info, describe, nulls, duplicates, and shape using summary method
  • Unique Value Inspection: Easily display unique values for any or all columns.
  • Type-based Column Selection: Find columns by dtype (e.g., int, float categorical).
  • Flexible Subsetting: Use the lookup method to view head, tail, or random samples.
  • Custom DataFrame Naming: Track multiple DataFrames with custom names for clarity.
  • Primary Key Detection: Automatically identify single or multi-column combinations that can serve as unique identifiers.

Installation

pip install edazer

Quick Start with Titanic Dataset

import seaborn as sns
from edazer import Edazer, interactive_df
from edazer.profiling import show_data_profile
from edazer import get_primary_key

# Enable interactive DataFrames (via itables)
interactive_df()

# Load dataset
titanic = sns.load_dataset('titanic')

# Initialize Edazer instance
titanic_dz = Edazer(titanic, backend="pandas", name="titanic")

# Complete DataFrame summary
titanic_dz.summarize_df()

# Data profiling report (via ydata_profiling)
show_data_profile(titanic_dz)

# Show unique values for specific columns
titanic_dz.show_unique_values(column_names=['class', 'embarked'], max_unique=5)

# Get float columns
print(titanic_dz.cols_with_dtype(['float'], exact=False))

# Combine methods: get object columns and show their unique values
titanic_dz.show_unique_values(column_names=titanic_dz.cols_with_dtype(dtypes=["object"]))

# To identify unique identifiers
get_primary_key(df, threshold=1.0, n_combos=2)

# View first few rows
print(titanic_dz.lookup("head"))

# Access raw DataFrame
print(titanic_dz.df.columns)

📘 API Reference

Edazer(df, backend="pandas", name=None)

Create an analyzer instance.

  • df: pd.DataFrame or pl.DataFrame
  • backend: "pandas" or "polars" (default: "pandas")
  • name: Optional string label for the DataFrame

summarize_df()

Print summary:

  • Schema/info
  • Descriptive stats
  • Null/duplicate counts
  • Unique values
  • Shape

show_unique_values(column_names=None, max_unique=10)

Show unique values for columns.

  • column_names: Optional list of columns
  • max_unique: Max unique values to display per column

cols_with_dtype(dtypes, exact=False, return_dtype_map=False)

Return columns matching specified dtypes.

  • dtypes: List of type strings (e.g. ["int", "object"])
  • exact: Match full dtype string (e.g. "int64")
  • return_dtype_map: If True, return {col: dtype}

lookup(option="head")

Quickly inspect data.

  • option: "head", "tail", or "sample"

🆕 get_primary_key(df, threshold=0.9, n_combos=1, valid_column_dtypes=None)

Identify column(s) or column combinations that can serve as unique keys.

Parameters

  • df – The input DataFrame.

  • threshold – Proportion of uniqueness required (default = 0.9).

  • n_combos– Number of columns to combine when testing composite keys (default = 1).

  • valid_column_dtypes – Data types to consider (default = ["int", "datetime64", "object"]).

Returns

List[str] or List[List[str]]: Candidate key columns or combinations that are likely unique identifiers.

Example usage

from edazer import get_primary_key
import pandas as pd

df = pd.DataFrame({
    "id": [1, 2, 3, 4],
    "name": ["A", "B", "C", "A"],
    "date": pd.date_range("2023-01-01", periods=4)
})

get_primary_key(df, threshold=1.0, n_combos=2)
# Output: [['id', 'name'], ['id', 'date'], ['name', 'date']]

Example Output

titanic_eda.show_unique_values(column_names=titanic_dz.cols_with_dtype(dtypes=["object"]))

# Output:
sex: ['male', 'female']
embarked: ['S', 'C', 'Q', nan]
who: ['man', 'woman', 'child']
embark_town: ['Southampton', 'Cherbourg', 'Queenstown', nan]
alive: ['no', 'yes']

Contributing

Contributions are highly welcome!

https://github.com/adarsh-79/edazer


License

MIT License


Author

adarsh3690704

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

edazer-0.1.4.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

edazer-0.1.4.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file edazer-0.1.4.1.tar.gz.

File metadata

  • Download URL: edazer-0.1.4.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for edazer-0.1.4.1.tar.gz
Algorithm Hash digest
SHA256 8a362fdb6c92fa2bb155c34653dcc82eaf1242f8ac571964659ba4eb4affc2a7
MD5 f99f594ceb978751f7eb87b1e1b9cdb8
BLAKE2b-256 ad3659f690ca3b34dc6dbd1efd18637c0b865471de08cc225a56333b8fdc19d9

See more details on using hashes here.

File details

Details for the file edazer-0.1.4.1-py3-none-any.whl.

File metadata

  • Download URL: edazer-0.1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for edazer-0.1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf8734e6d70a51211fc3d48ba2c918c59a290742af9554ed70b02d743f426d03
MD5 a390934a8abc28ed0e91bfc93794430c
BLAKE2b-256 eff2f29a46848df400a69fa061e3b11a5d612c78c055b2d9ad62b8c8fed08d66

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