Metadata-Version: 2.4
Name: dfglimpse
Version: 0.1.0
Summary: A quick, per-column glimpse of a pandas DataFrame for exploratory data analysis.
Project-URL: Homepage, https://github.com/rockyhg/dfglimpse
Project-URL: Repository, https://github.com/rockyhg/dfglimpse
Project-URL: Issues, https://github.com/rockyhg/dfglimpse/issues
Author: RockyHG
License: MIT License
        
        Copyright (c) 2025 RockyHG
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: data-analysis,dataframe,eda,pandas,summary
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pandas>=2.0
Description-Content-Type: text/markdown

# 📊 dfglimpse

[![PyPI](https://img.shields.io/pypi/v/dfglimpse)](https://pypi.org/project/dfglimpse/)
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue)](https://www.python.org/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)

A quick, per-column **glimpse** of a pandas DataFrame for exploratory data analysis (EDA).

`glimpse` summarizes each column of a DataFrame in a single table — its dtype, how
many values are missing (count and percentage), how many unique values it has, and
either the full set of unique values or a short preview for high-cardinality columns.

## Installation

```bash
pip install dfglimpse
```

## Quick start

```python
import pandas as pd
from dfglimpse import glimpse

df = pd.read_csv("sample_data.csv")
glimpse(df)
```

Output:

```
       Column  dtypes  NaN Count  NaN %  Nunique                               Unique Values
           Id   int64          0    0.0       20                    [1, 2, 3] ... (+17 more)
   MSSubClass   int64          0    0.0        5                        [20, 60, 70, 50, 30]
     MSZoning  object          0    0.0        4                       [RL, RM, C (all), RH]
  LotFrontage float64          4   20.0       15           [65.0, 80.0, 70.0] ... (+12 more)
      LotArea   int64          0    0.0       20          [8450, 9600, 11250] ... (+17 more)
SaleCondition  object          0    0.0        5 [Normal, Abnorml, Partial, AdjLand, Alloca]
```

The result is an ordinary `DataFrame`, so you can sort or filter it — for example,
`glimpse(df).sort_values("NaN %", ascending=False)` to find the columns with the most
missing values.

## API

```python
glimpse(df, columns=None, max_unique=10, n_samples=3) -> pandas.DataFrame
```

| Parameter | Type | Default | Description |
|---|---|---|---|
| `df` | `pandas.DataFrame` | — | The DataFrame to inspect. |
| `columns` | `list[str] \| None` | `None` | Subset of columns to inspect. `None` inspects every column. |
| `max_unique` | `int` | `10` | Columns with at most this many unique values show every unique value; columns with more show a preview instead. |
| `n_samples` | `int` | `3` | Number of sample values shown in the preview for high-cardinality columns. |

Returns a `DataFrame` with one row per column and the columns
`Column`, `dtypes`, `NaN Count`, `NaN %`, `Nunique`, `Unique Values`.

Missing values are excluded from `Nunique` and from the displayed unique values, so
they stay consistent with each other.

## Requirements

- Python 3.10+
- pandas 2.0+

## License

MIT License. See [LICENSE](LICENSE).

---

## 日本語

`dfglimpse` は、pandas の DataFrame の**各列を一望**するための小さな EDA 補助ツールです。
`glimpse(df)` を呼ぶと、各列について以下を1つの表にまとめて返します。

- データ型（dtype）
- 欠損（NaN）数と割合（%）
- ユニークな値の個数（欠損は除外）
- ユニークな値の内容（多い列は先頭数件のプレビュー）

### インストール

```bash
pip install dfglimpse
```

### 使い方

```python
import pandas as pd
from dfglimpse import glimpse

df = pd.read_csv("sample_data.csv")
glimpse(df)
```

戻り値はただの `DataFrame` なので、`glimpse(df).sort_values("NaN %", ascending=False)`
のように並べ替え・絞り込みができます。

### 引数

| 引数 | 既定値 | 説明 |
|---|---|---|
| `df` | — | 対象の DataFrame |
| `columns` | `None` | 対象の列（リスト）。`None` で全列 |
| `max_unique` | `10` | この数以下なら全ユニーク値を表示。超えるとプレビュー表示 |
| `n_samples` | `3` | プレビュー時に見せるサンプル値の件数 |
