# starboard-jupyter

> Jupyter-backed cells for Starboard Notebook

Latest version **0.2.10** (published 2021-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install starboard-jupyter
pnpm add starboard-jupyter
yarn add starboard-jupyter
bun add starboard-jupyter
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.10 |
| Published | 2021-06-11 |
| First published | 2021-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 6.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Guido Zuidhof |
| Maintainers | gzuidhof |
| Keywords | jupyter, starboard, python, starboard-notebook, notebook |

## Links

- npm: https://www.npmjs.com/package/starboard-jupyter
- Repository: https://github.com/gzuidhof/starboard-jupyter
- Homepage: https://github.com/gzuidhof/starboard-jupyter#readme
- Issues: https://github.com/gzuidhof/starboard-jupyter/issues
- npm.io page: https://npm.io/package/starboard-jupyter

## Dependencies (7)

- [lit](https://npm.io/package/lit.md) *
- [requirejs](https://npm.io/package/requirejs.md) ^2.3.6
- [@types/katex](https://npm.io/package/@types/katex.md) ^0.11.0
- [@jupyterlab/services](https://npm.io/package/@jupyterlab/services.md) ^6.0.6
- [@jupyterlab/outputarea](https://npm.io/package/@jupyterlab/outputarea.md) ^3.0.7
- [@jupyterlab/rendermime](https://npm.io/package/@jupyterlab/rendermime.md) ^3.0.7
- [@jupyterlab/theme-light-extension](https://npm.io/package/@jupyterlab/theme-light-extension.md) ^3.0.8

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.2.10 (latest) — 2021-06-11
- 0.2.9 — 2021-05-19
- 0.2.8 — 2021-05-13
- 0.2.7 — 2021-05-06
- 0.2.6 — 2021-05-06
- 0.2.5 — 2021-04-29
- 0.2.4 — 2021-04-29
- 0.2.3 — 2021-04-29
- 0.2.2 — 2021-04-28
- 0.2.1 — 2021-04-28
- 0.2.0 — 2021-04-28
- 0.1.4 — 2021-04-21
- 0.1.3 — 2021-04-21
- 0.1.2 — 2021-04-17
- 0.1.1 — 2021-04-17
- … 1 more at https://npm.io/package/starboard-jupyter/versions

## README

# starboard-jupyter
Experiment for support of Starboard cells that are backed by a Jupyter kernel.

## Screenshot
![](https://i.imgur.com/WFyAi5R.png)

## Setup


### 1. Install Jupyter Kernel Gateway

```
pip install jupyter_kernel_gateway
```

### 2. Start the Jupyter Kernel gateway:
```shell
# For some reason we need
KG_ALLOW_METHODS="*" \
jupyter kernelgateway \
  --KernelGatewayApp.allow_origin="https://gz.starboard.host" \
  --KernelGatewayApp.allow_headers="authorization,content-type,x-xsrftoken" \
  --KernelGatewayApp.max_age=3600 \\
  --JupyterWebsocketPersonality.list_kernels=True

# or for a specific localhost port
KG_ALLOW_METHODS="*" \
jupyter kernelgateway \
  --KernelGatewayApp.allow_origin="http://localhost:9001" \
  --KernelGatewayApp.allow_headers="authorization,content-type,x-xsrftoken" \
  --KernelGatewayApp.max_age=3600 \
  --JupyterWebsocketPersonality.list_kernels=True
```
*(change the origin to be the origin where you are hosting your notebook sandbox)*

> Note 1: right now auth with a token doesn't work for the websocket connection. The token simply doesn't get passed from the client, so for now there is no auth other than the origin check (and the fact that you can stay entirely within localhost). When that is fixed you should add `--KernelGatewayApp.auth_token="my-super-strong-secret-example"`

> Note 2: For some reason `--KernelGateWayApp.allow_methods="POST,GET,OPTIONS,DELETE"` does not work, so we use the `KG_ALLOW_METHODS` env variable.

> Note 3: It also works with a plain Jupyter Notebook or JupyterLab, but you will need to allow the origins and set the auth token with another method.

### 3. Initialize the plugin in your notebook

You can use [this notebook](https://starboard.gg/nb/nA3wm87) (or without Starboard's interface around it [here](https://gz.starboard.host/v1/embed/0.8.9/br0qtd223akg00eiaos0/nA3wm87/)) to try it out.

```javascript
// Or wherever you are hosting it, could be from some CDN.
import "http://localhost:8080/dist/starboard-jupyter.js";

registerJupyterPlugin({
    serverSettings: {
        baseUrl: "http://localhost:8888",
        token: "my-super-strong-secret-example",
    }
})
```

### 4. Create Jupyter cells

Who even needs Jupyter's interface anymore? ;)

## License

[MIT](./LICENSE)

---
_Source: https://npm.io/package/starboard-jupyter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
