Metadata-Version: 2.5
Name: pretty-little-summary
Version: 0.3.1
Summary: Automatic structured summaries of Python objects - DataFrames, arrays, models, and more
Project-URL: Homepage, https://github.com/dwootton/pretty-little-summary
Project-URL: Repository, https://github.com/dwootton/pretty-little-summary
Project-URL: Issues, https://github.com/dwootton/pretty-little-summary/issues
Project-URL: Documentation, https://dwootton.github.io/pretty-little-summary
Author-email: Dylan <wootton.dylan@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Dylan Wootton
        
        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-science,introspection,jupyter,metadata,summarization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: altair>=5.0.0; extra == 'all'
Requires-Dist: attrs>=23.0.0; extra == 'all'
Requires-Dist: bokeh>=3.0.0; extra == 'all'
Requires-Dist: h5py>=3.9.0; extra == 'all'
Requires-Dist: ipython>=8.0.0; extra == 'all'
Requires-Dist: jax>=0.4.0; extra == 'all'
Requires-Dist: matplotlib>=3.8.0; extra == 'all'
Requires-Dist: networkx>=3.0.0; extra == 'all'
Requires-Dist: numpy>=1.24.0; extra == 'all'
Requires-Dist: pandas>=2.0.0; extra == 'all'
Requires-Dist: pillow>=10.0.0; extra == 'all'
Requires-Dist: plotly>=5.0.0; extra == 'all'
Requires-Dist: polars>=0.20.0; extra == 'all'
Requires-Dist: pyarrow>=12.0.0; extra == 'all'
Requires-Dist: pydantic>=2.0.0; extra == 'all'
Requires-Dist: requests>=2.31.0; extra == 'all'
Requires-Dist: scikit-learn>=1.4.0; extra == 'all'
Requires-Dist: scipy>=1.10.0; extra == 'all'
Requires-Dist: seaborn>=0.13.0; extra == 'all'
Requires-Dist: statsmodels>=0.14.0; extra == 'all'
Requires-Dist: tensorflow>=2.0.0; extra == 'all'
Requires-Dist: torch>=2.0.0; extra == 'all'
Requires-Dist: xarray>=2024.0.0; extra == 'all'
Provides-Extra: altair
Requires-Dist: altair>=5.0.0; extra == 'altair'
Provides-Extra: attrs
Requires-Dist: attrs>=23.0.0; extra == 'attrs'
Provides-Extra: bokeh
Requires-Dist: bokeh>=3.0.0; extra == 'bokeh'
Provides-Extra: data
Requires-Dist: numpy>=1.24.0; extra == 'data'
Requires-Dist: pandas>=2.0.0; extra == 'data'
Requires-Dist: polars>=0.20.0; extra == 'data'
Requires-Dist: pyarrow>=12.0.0; extra == 'data'
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Provides-Extra: evals-ci
Requires-Dist: attrs>=23.0.0; extra == 'evals-ci'
Requires-Dist: matplotlib>=3.8.0; extra == 'evals-ci'
Requires-Dist: networkx>=3.0.0; extra == 'evals-ci'
Requires-Dist: numpy>=1.24.0; extra == 'evals-ci'
Requires-Dist: pandas>=2.0.0; extra == 'evals-ci'
Requires-Dist: pillow>=10.0.0; extra == 'evals-ci'
Requires-Dist: polars>=0.20.0; extra == 'evals-ci'
Requires-Dist: pyarrow>=12.0.0; extra == 'evals-ci'
Requires-Dist: pydantic>=2.0.0; extra == 'evals-ci'
Requires-Dist: scikit-learn>=1.4.0; extra == 'evals-ci'
Requires-Dist: scipy>=1.10.0; extra == 'evals-ci'
Requires-Dist: statsmodels>=0.14.0; extra == 'evals-ci'
Requires-Dist: xarray>=2024.0.0; extra == 'evals-ci'
Provides-Extra: h5py
Requires-Dist: h5py>=3.9.0; extra == 'h5py'
Provides-Extra: ipython
Requires-Dist: ipython>=8.0.0; extra == 'ipython'
Provides-Extra: jax
Requires-Dist: jax>=0.4.0; extra == 'jax'
Provides-Extra: matplotlib
Requires-Dist: matplotlib>=3.8.0; extra == 'matplotlib'
Provides-Extra: ml
Requires-Dist: jax>=0.4.0; extra == 'ml'
Requires-Dist: scikit-learn>=1.4.0; extra == 'ml'
Requires-Dist: scipy>=1.10.0; extra == 'ml'
Requires-Dist: statsmodels>=0.14.0; extra == 'ml'
Requires-Dist: tensorflow>=2.0.0; extra == 'ml'
Requires-Dist: torch>=2.0.0; extra == 'ml'
Provides-Extra: networkx
Requires-Dist: networkx>=3.0.0; extra == 'networkx'
Provides-Extra: numpy
Requires-Dist: numpy>=1.24.0; extra == 'numpy'
Provides-Extra: pandas
Requires-Dist: pandas>=2.0.0; extra == 'pandas'
Provides-Extra: pillow
Requires-Dist: pillow>=10.0.0; extra == 'pillow'
Provides-Extra: plotly
Requires-Dist: plotly>=5.0.0; extra == 'plotly'
Provides-Extra: polars
Requires-Dist: polars>=0.20.0; extra == 'polars'
Provides-Extra: pyarrow
Requires-Dist: pyarrow>=12.0.0; extra == 'pyarrow'
Provides-Extra: pydantic
Requires-Dist: pydantic>=2.0.0; extra == 'pydantic'
Provides-Extra: pytorch
Requires-Dist: torch>=2.0.0; extra == 'pytorch'
Provides-Extra: requests
Requires-Dist: requests>=2.31.0; extra == 'requests'
Provides-Extra: science
Requires-Dist: h5py>=3.9.0; extra == 'science'
Requires-Dist: networkx>=3.0.0; extra == 'science'
Requires-Dist: scipy>=1.10.0; extra == 'science'
Requires-Dist: xarray>=2024.0.0; extra == 'science'
Provides-Extra: scipy
Requires-Dist: scipy>=1.10.0; extra == 'scipy'
Provides-Extra: seaborn
Requires-Dist: seaborn>=0.13.0; extra == 'seaborn'
Provides-Extra: sklearn
Requires-Dist: scikit-learn>=1.4.0; extra == 'sklearn'
Provides-Extra: statsmodels
Requires-Dist: statsmodels>=0.14.0; extra == 'statsmodels'
Provides-Extra: tensorflow
Requires-Dist: tensorflow>=2.0.0; extra == 'tensorflow'
Provides-Extra: viz
Requires-Dist: altair>=5.0.0; extra == 'viz'
Requires-Dist: bokeh>=3.0.0; extra == 'viz'
Requires-Dist: matplotlib>=3.8.0; extra == 'viz'
Requires-Dist: pillow>=10.0.0; extra == 'viz'
Requires-Dist: plotly>=5.0.0; extra == 'viz'
Requires-Dist: seaborn>=0.13.0; extra == 'viz'
Provides-Extra: web
Requires-Dist: requests>=2.31.0; extra == 'web'
Provides-Extra: xarray
Requires-Dist: xarray>=2024.0.0; extra == 'xarray'
Description-Content-Type: text/markdown

# Pretty Little Summary

Automatic structured summaries of Python objects — DataFrames, arrays, models, plots, and more.

## Install

```bash
pip install pretty-little-summary
```

Optional adapters are enabled automatically when their libraries are installed.

No install? Try it in the browser: **[live playground](https://dwootton.github.io/pretty-little-summary/playground.html)** (runs via Pyodide, nothing uploaded).

## Features

- Single function API: `pls.describe(obj)`
- 40+ adapters across data, viz, and ML libraries
- Works with built-ins out of the box (no required deps)
- Jupyter/IPython history capture for better context
- Deterministic, bounded question-focused tabular views with pluggable relevance scorers

## Quick Start

```python
import pretty_little_summary as pls
import pandas as pd

df = pd.DataFrame({
    "product": ["Widget", "Gadget", "Doohickey"],
    "price": [19.99, 29.99, 39.99],
    "quantity": [100, 50, 75]
})

result = pls.describe(df)
print(result.content)
print(result.meta)

# Rank all columns for a question without changing the full profile.
focused = pls.focus_profile(
    result,
    "How does price relate to quantity?",
    max_columns=8,
    max_chars=4000,
)
print(focused.content)
```

## Built-in Types

```python
import pretty_little_summary as pls

print(pls.describe([1, 2, 3]).content)
print(pls.describe({"name": "Alice", "age": 30}).content)
```

## NumPy Arrays

```python
import numpy as np
import pretty_little_summary as pls

arr = np.random.rand(100, 50)
result = pls.describe(arr)
print(result.content)
```

## Pandas DataFrames

```python
import pandas as pd
import pretty_little_summary as pls

df = pd.read_csv("data.csv")
result = pls.describe(df)
print(result.content)
```

## Files and dynamic imports

File paths are detected through a shared capability registry using extensions
and, where available, magic bytes. In native Python, `dynamic_imports=True`
imports matching optional libraries that are already installed; it never runs a
package manager or accesses the network:

```python
import pretty_little_summary as pls

result = pls.describe("measurements.h5", dynamic_imports=True)
print(result.content)

# Hosts that manage packages themselves can inspect the same requirements:
print(pls.requirements_for_path("measurements.h5"))
```

The browser playground uses these requirements to install missing Pyodide or
micropip packages automatically, so there is no package-tier selector.

## Matplotlib Figures

```python
import matplotlib.pyplot as plt
import pretty_little_summary as pls

fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 5, 6])
result = pls.describe(fig)
print(result.content)
```

## History Tracking (Jupyter/IPython)

When running inside Jupyter, `pretty_little_summary` can capture recent code history that created your object:

```python
import pandas as pd
import pretty_little_summary as pls

df = pd.read_csv("data.csv")
df_clean = df.dropna()
result = pls.describe(df_clean)
print(result.history)
```

## Docs site

The docs (`docs/index.html`, `docs/playground.html`, `docs/eval-report.html`)
are a static site with no build step. To run it locally:

```bash
cd docs && python3 -m http.server 8000
```

Then open http://localhost:8000. Notes:

- `playground.html` loads [Pyodide](https://pyodide.org) from a CDN, so it
  needs internet access even when served locally.
- `playground.html` installs `pretty-little-summary` from `docs/dist/*.whl`
  so it always matches this commit's `src/` instead of a possibly-stale PyPI
  release. That wheel isn't committed — CI builds it on every docs deploy via
  `python -m build --wheel -o docs/dist`. Build it yourself before serving
  locally, or the playground falls back to installing from PyPI:
  ```bash
  .venv/bin/python -m build --wheel -o docs/dist
  ```
- `eval-report.html` isn't committed — generate it first with:
  ```bash
  .venv/bin/python -m evals.runner fetch
  .venv/bin/python -m evals.runner run
  .venv/bin/python -m evals.viewer --out docs/eval-report.html
  ```
  (CI does this automatically on every docs deploy.) Its markup lives in the
  committed `docs/eval-report-template.html`; `evals/viewer.py` only injects
  run data into it.
- The playground's curated/gallery example code comes from
  `docs/examples/*.txt`, regenerated via:
  ```bash
  .venv/bin/python scripts/export_examples.py
  ```

## Troubleshooting

### `ModuleNotFoundError: No module named 'pretty_little_summary'`

- Ensure you installed the package in the current environment.
- Restart your kernel or interpreter.

### Missing optional libraries

If an adapter isn’t available, install its library:

```bash
pip install pandas numpy matplotlib
```

Or install all optional dependencies:

```bash
pip install pretty-little-summary[all]
```
