Metadata-Version: 2.4
Name: jupyter-alloy-notebooks-retro
Version: 0.1.0
Summary: SQL, DuckDB and R cells with result tables, charts and a connection manager for classic Jupyter Notebook 6 (legacy RISE environments).
Author: Robert Pettis
Author-email: pettis.robert@gmail.com
License: BSD-3-Clause
Classifier: Framework :: Jupyter
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: notebook<7,>=6
Requires-Dist: alloy-notebooks>=0.5.11
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# jupyter-alloy-notebooks-retro

> **⚠️ This is a purpose-built backport. You almost certainly want the main
> package instead.**
>
> It exists to run Alloy Notebooks inside a **legacy classic Jupyter Notebook
> 6.x environment** (a `notebook 6.5.x` + `RISE 5.7` presentation setup).
> Classic Notebook 6 cannot load JupyterLab extensions, so this is a
> from-scratch nbextension port, maintained on a best-effort basis.
>
> **If you are using JupyterLab 4 (or modern Jupyter in general), do not install
> this.** Use the real extension instead:
>
> ```
> pip install alloy-notebooks
> ```
>
> (source: [Columbia-Data-Labs/alloy-notebooks](https://github.com/Columbia-Data-Labs/alloy-notebooks))

## What it does

- **SQL, DuckDB and R cells** — pick a language from the unified cell dropdown.
  The cell's source is never rewritten; only what is sent to the kernel is.
- **Result tables and charts** — Table/Chart toggle, an opt-in chart per column
  computed over the full result, click-to-rename chart titles, and Configure
  Chart (bar, line, scatter, pie, histogram, area).
- **Connection manager** — a slide-over panel (toolbar database button or the
  **Alloy** menu) to save, edit and connect to SQL Server, PostgreSQL, MySQL,
  SQLite and DuckDB. Live connections are restored after a kernel restart.
- **Query indicator**, per-cell highlighting and language icons.
- **Everything else from the kernel side** — `alloy_connect`, `%%alloy_sql`,
  `%alloy_to_r` and the other magics come from the `alloy-notebooks` dependency.

Notebooks round-trip with the JupyterLab extension: both use the same cell
metadata (`alloy:language`, `alloy:resultView`, `alloy:chartConfig`,
`alloy:chartShown`, `alloy:chartTitles`), the same result MIME type, and the same
saved connections in `~/.alloy/connections.json`.

During a RISE slideshow the connection panel and language icons are hidden.

## Install

```bash
conda activate rise6
pip install jupyter-alloy-notebooks-retro
```

Then restart `jupyter notebook`. The nbextension and server extension enable
themselves at install time. Installed alongside it, `alloy-notebooks` also brings
`jupysql`, `plotly` and their dependencies.

DuckDB and R cells need their engines, as they do in the main package:

```bash
pip install duckdb      # DuckDB cells
pip install rpy2        # R cells (R itself must also be installed)
```

To uninstall:

```bash
pip uninstall jupyter-alloy-notebooks-retro
```

## Requirements

- `notebook >= 6, < 7` (Notebook 7 is Lab-based and is served by the main package)
- Python 3.10+
- A current browser (Chrome/Edge)

## Differences from the JupyterLab extension

- The **language-icon** preference is stored in the browser's `localStorage`,
  because classic Notebook has no Settings Registry.
- The core cell-type dropdown is hidden in favour of the unified one, as in Lab.
  With several cells selected, the dropdown applies to all of them.

## License

BSD-3-Clause, same as the parent project.
