Metadata-Version: 2.4
Name: omle-viewer
Version: 0.1.0rc1
Summary: Interactive DAG viewer for OMLE models — Jupyter display and browser CLI
Author: OMLE
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/openmle/omle-viewer
Project-URL: Repository, https://github.com/openmle/omle-viewer
Project-URL: Issues, https://github.com/openmle/omle-viewer/issues
Project-URL: OMLE format, https://github.com/openmle/omle
Keywords: machine learning,omle,visualization,dag,jupyter,viewer
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Jupyter
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 :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: omle
Provides-Extra: dev
Requires-Dist: jupyterlab>=4.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.16; extra == "dev"
Requires-Dist: pre-commit>=4.0; extra == "dev"
Dynamic: license-file

# omle-viewer (Python)

Jupyter display integration and browser CLI for [OMLE](../../omle) models — renders the interactive DAG viewer inline in a notebook cell or opens it in the default browser.

Works in **JupyterLab, Jupyter Notebook, VS Code notebooks, and Google Colab** with no widget extensions required.

## Setup

### 1. Build the viewer bundle

```bash
cd omle-viewer
./build.sh
```

This builds a self-contained `viewer.html` (all JS/CSS inlined) and places it in the package's `static/` directory. Re-run whenever the viewer source changes.

### 2. Install the package

```bash
pip install -e omle-viewer/python/
```

For protobuf (`.omle`) support:

```bash
pip install -e "omle-viewer/python/[proto]"
```

## CLI

Open any model file directly in the browser:

```bash
omle-viewer model.json
omle-viewer model.omle
```

## Jupyter usage

Import `omle_viewer` once per session. After that, returning any `OMLEModel` from a cell renders the interactive diagram automatically:

```python
import omle_viewer
from omle.ir.model import OMLEModel

model = OMLEModel(...)
model                       # ← renders the DAG viewer inline, no show() needed
```

### Custom height or live-update handle

```python
from omle_viewer import show

w = show(model, height=700)

# In another cell, display an updated model in place:
w.update(updated_model)
```

### Open in browser from Python

```python
from omle_viewer import show_in_browser

show_in_browser(model)
```
