Metadata-Version: 2.4
Name: fg-data-profiling-wasm
Version: 0.2.0
Summary: Pyodide-friendly fork of fg-data-profiling (ydata-profiling) for browser WASM
Author: awesome-wasm-packages
Maintainer: awesome-wasm-packages
License-Expression: MIT
Project-URL: Homepage, https://github.com/awesome-wasm-packages/fg-data-profiling-wasm
Project-URL: Upstream, https://github.com/Data-Centric-AI-Community/fg-data-profiling
Keywords: pandas,profiling,pyodide,wasm,eda
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scipy<1.19,>=1.8
Requires-Dist: pandas!=1.4.0,<4.0,>1.5
Requires-Dist: matplotlib<3.11,>=3.5
Requires-Dist: pydantic<3,>=2
Requires-Dist: PyYAML<6.1,>=6.0.3
Requires-Dist: jinja2<3.2,>=3.1.6
Requires-Dist: visions<0.8.2,>=0.7.5
Requires-Dist: numpy<2.5,>=1.22
Requires-Dist: filetype>=1.0.0
Requires-Dist: requests<3,>=2.32.0
Requires-Dist: tqdm<5,>=4.66.3
Requires-Dist: seaborn<0.14,>=0.10.1
Requires-Dist: multimethod<2,>=1.4
Requires-Dist: statsmodels<1,>=0.13.2
Requires-Dist: typeguard<5,>=4
Requires-Dist: imagehash==4.3.2
Requires-Dist: Pillow>=9.0.0
Requires-Dist: wordcloud>=1.9.4
Requires-Dist: dacite<2,>=1.9
Provides-Extra: native
Requires-Dist: minify-html>=0.15.0; extra == "native"
Requires-Dist: phik<0.13,>=0.12.5; extra == "native"
Requires-Dist: numba<0.63,>=0.60; extra == "native"
Dynamic: license-file

# fg-data-profiling-wasm

Pyodide-friendly fork of [fg-data-profiling](https://github.com/Data-Centric-AI-Community/fg-data-profiling) (formerly ydata-profiling / pandas-profiling).

**You do not compile this package to WASM.** Upstream already ships as a pure-Python wheel (`py2.py3-none-any`). This fork only does dependency surgery so it can install and run under Pyodide.

## What changed vs upstream

| Change | Why |
|---|---|
| Drop hard deps: `numba`, `minify-html`, `phik` | Native / JIT; broken or impractical in browser WASM |
| Default `html.minify_html = False` | Avoid lazy-importing the Rust `minify-html` extension |
| Soft-fail if minify is requested but missing | Safer in constrained environments |
| Keep `phi_k` off (already upstream default) | Avoid needing `phik` |
| Package name `fg-data-profiling-wasm` | Distinguish the Pyodide wheel from upstream |
| Allow `pandas>=3` (`<4`) | Upstream still pins `<3.0`; this fork patches typeset/string paths |

Optional native extras remain under `[project.optional-dependencies] native` for desktop use.

## Layout

```
src/                  # vendored upstream + patches
patches/              # 0001 pyodide + 0002 pandas3 + 0003 display + 0004 font scale (reapplied on sync)
scripts/sync-upstream.sh
upstream.lock.json    # pinned upstream ref + commit
pyodide/              # install helper + dependency matrix
pyproject.toml        # Pyodide-friendly dependency set
```

## Upgrading from upstream

Pinned upstream lives in [`upstream.lock.json`](upstream.lock.json).

```bash
# Is upstream ahead of our lock?
make check-upstream
# or: ./scripts/sync-upstream.sh --check

# Pull latest develop (or whatever ref is in the lock), re-apply patches,
# refresh dependency pins, update the lockfile
make sync
# or: ./scripts/sync-upstream.sh

# Sync a release tag / other ref
make sync-ref REF=v4.9.0
# or: ./scripts/sync-upstream.sh --ref v4.9.0

# After a successful sync, bump our PyPI version
./scripts/sync-upstream.sh --bump patch

# If a patch no longer applies: fix src/ by hand, then regenerate the patch series
./scripts/sync-upstream.sh --regen-patches
```

Typical release flow after upstream moves:

```bash
./scripts/sync-upstream.sh --ref develop --bump patch
python -m build
# review git diff, commit, push, twine upload dist/*
```

A weekly GitHub Action (`.github/workflows/upstream-check.yml`) opens/comments on an issue when the lock is behind.

## Build a wheel

```bash
python -m pip install build
python -m build    # → dist/fg_data_profiling_wasm-*-py2.py3-none-any.whl
```

Current artifact:

- `dist/fg_data_profiling_wasm-0.1.1-py2.py3-none-any.whl` (purelib; PyPI-compatible; pandas `<4`)

## Publish to PyPI (GitHub Actions)

The package is **not on PyPI yet**. Publishing is automated via [Trusted Publishing](https://docs.pypi.org/trusted-publishers/) (OIDC) — no long-lived API token in the repo.

### One-time PyPI setup

1. Sign in at https://pypi.org/
2. Open **Publishing** → **Add a new pending publisher** (project does not exist yet):
   - **PyPI project name:** `fg-data-profiling-wasm`
   - **Owner:** `awesome-wasm-packages`
   - **Repository:** `fg-data-profiling-wasm`
   - **Workflow name:** `publish.yml`
   - **Environment name:** `pypi`
3. In GitHub → **Settings → Environments** → create environment `pypi` (optional protection rules / required reviewers).

### Publish a version

```bash
# bump version in VERSION + pyproject.toml (or)
./scripts/sync-upstream.sh --bump patch
git add -A && git commit -m "Release $(tr -d '[:space:]' < VERSION)"
git tag "v$(tr -d '[:space:]' < VERSION)"
git push && git push --tags
```

Then create a GitHub Release for that tag (or use the UI). The `Publish to PyPI` workflow builds the wheel and uploads it.

You can also run the workflow manually: **Actions → Publish to PyPI → Run workflow**.

## Use in Pyodide / PyConsole

Package name on PyPI is **`fg-data-profiling-wasm`**; import name is **`data_profiling`**.

```python
import micropip
await micropip.install("fg-data-profiling-wasm")

import pandas as pd
from data_profiling import ProfileReport

df = pd.DataFrame({"a": [1, 2, 3], "b": ["x", "y", "x"]})
report = ProfileReport(
    df,
    minimal=True,
    progress_bar=False,
    correlations={"phi_k": {"calculate": False}},
    html={"minify_html": False},
)
html = report.to_html()
```

Notes for PyConsole (Pyodide 314 / Python 3.14):

- Use `>=0.1.2` (older releases reject Python 3.14 / pin numpy/scipy/matplotlib too tightly).
- Auto-install-on-import will **not** find this package from `import data_profiling` — install by PyPI name first.
- Prefer `minimal=True` and turn off `phi_k` / HTML minify for speed and missing native deps.

### Display

PyConsole already detects `ProfileReport` and calls `to_html()` (no package API required). This fork also adds:

- `report.display()` — `js.render` in PyConsole, else Jupyter `to_notebook_iframe()`
- `_repr_html_()` — returns an iframe HTML string (works without IPython)

```python
report = ProfileReport(df, minimal=True, progress_bar=False)
report  # last expression: PyConsole / Jupyter rich display
# or: report.display()
```

Helpers live in [`pyodide/install.py`](pyodide/install.py); dependency notes in [`pyodide/DEPS.md`](pyodide/DEPS.md).

## Difficulty (recap)

| Goal | Difficulty |
|---|---|
| Install this pure wheel in Pyodide | Easy |
| Usable `ProfileReport` (core EDA, `minimal=True`) | Medium |
| Full upstream fidelity (`phik`, minify, numba-shaped features) | Hard / skip |

## Upstream

Based on [Data-Centric-AI-Community/fg-data-profiling](https://github.com/Data-Centric-AI-Community/fg-data-profiling). Tracked commit is in `upstream.lock.json`. MIT-licensed; see `LICENSE`.
