Metadata-Version: 2.4
Name: yw-jupyter
Version: 0.1.0
Summary: A JupyterLab extension for visualizing notebook cells using YesWorkflow.
Project-URL: Homepage, https://github.com/CIRSS/yw-jupyter.git
Project-URL: Bug Tracker, https://github.com/CIRSS/yw-jupyter.git/issues
Project-URL: Repository, https://github.com/CIRSS/yw-jupyter.git.git
Author-email: "Shin-Rong Tsai, Timothy McPhillips, Meng Li" <turquoisea.tsai@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2026, Shin-Rong Tsai, Timothy McPhillips, Meng Li
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: jupyter,jupyterlab,jupyterlab-extension
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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
Requires-Python: >=3.9
Requires-Dist: jupyterlab>=4.0.0
Requires-Dist: yw-core<1,>=0.1.0
Description-Content-Type: text/markdown

# yw-jupyter

![PyPI - Version](https://img.shields.io/pypi/v/yw-jupyter?style=for-the-badge)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/CIRSS/yw-jupyter/build.yml?branch=main&style=for-the-badge)

A JupyterLab extension build upon ReactFlow for visualizing notebook cells using YesWorkflow.

- The extension adds a "YesWorkflow" tab to the JupyterLab sidebar and cell toolbar.
- Clicking the "YesWorkflow" tab opens the YesWorkflow panel.
- The panel displays a graph representation of the current notebook's cells and their relationships based on [`yw-core`](https://github.com/CIRSS/yw-core).
- Notebook cells and graph nodes are in sync:
  - Selecting a cell highlights the corresponding node in the graph and vice versa.
  - Editing cells updates the contents in the node in real-time and vice versa.

![demo-v0.1](./doc/static/yw-jupyter-demo-v0.1.gif)

## Install

### PyPI

> [!NOTE]
> Recommended installation method.

```bash
pip install yw-jupyter
```

### Install from source

> [!WARNING]
> Avoid installing from source unless you need the latest features or development mode.

- Requirements:
  - `JupyterLab` >= 4.0.0
  - `yw-core` >= 0.1.0, < 1.0.0

```bash
git clone https://github.com/CIRSS/yw-jupyter.git yw-jupyter
cd yw-jupyter
jlpm install
jlpm build:lib
jlpm build:prod
jupyter labextension develop . --overwrite
```

## Troubleshooting

Make sure we see `yw-jupyter` is enabled in JupyterLab extensions list:

```bash
>>> jupyter labextension list
JupyterLab v4.5.3
~/Documents/GitHub/yw-jupyter/.venv/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        yw-jupyter v0.1.0 enabled OK
```

## Known Issues and Future Work

- Code block's cursor in graph node not matching the actual cursor position.
- Currently, support only static analysis of notebook cells using [`yw-core`](https://github.com/CIRSS/yw-core). Supporting dynamic analysis via runtime provenance capture is planned for future releases.
- Bugs when multiple notebooks and yw-jupyter extensions are open in JupyterLab simultaneously.
