Metadata-Version: 2.4
Name: netbook
Version: 0.6.0
Summary: Jupyter notebook for terminal
Project-URL: homepage, https://github.com/lyovushka/netbook
Author-email: haykazyan@zoho.com
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: appnope==0.1.4; sys_platform == 'darwin'
Requires-Dist: asttokens==3.0.1
Requires-Dist: attrs==25.4.0
Requires-Dist: cffi==2.0.0
Requires-Dist: colorama==0.4.6; sys_platform == 'win32'
Requires-Dist: comm==0.2.3
Requires-Dist: debugpy==1.8.17
Requires-Dist: decorator==5.2.1
Requires-Dist: executing==2.2.1
Requires-Dist: fastjsonschema==2.21.2
Requires-Dist: ipykernel==7.1.0
Requires-Dist: ipython-pygments-lexers==1.1.1
Requires-Dist: ipython==9.7.0
Requires-Dist: jedi==0.19.2
Requires-Dist: jsonschema-specifications==2025.9.1
Requires-Dist: jsonschema==4.25.1
Requires-Dist: jupyter-client==8.6.3
Requires-Dist: jupyter-core==5.9.1
Requires-Dist: linkify-it-py==2.0.3
Requires-Dist: markdown-it-py==4.0.0
Requires-Dist: matplotlib-inline==0.2.1
Requires-Dist: mdit-py-plugins==0.5.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: nbformat==5.10.4
Requires-Dist: nest-asyncio==1.6.0
Requires-Dist: packaging==25.0
Requires-Dist: parso==0.8.5
Requires-Dist: pexpect==4.9.0; sys_platform != 'emscripten' and sys_platform != 'win32'
Requires-Dist: pillow==12.0.0
Requires-Dist: platformdirs==4.5.0
Requires-Dist: prompt-toolkit==3.0.52
Requires-Dist: psutil==7.1.3
Requires-Dist: ptyprocess==0.7.0; sys_platform != 'emscripten' and sys_platform != 'win32'
Requires-Dist: pure-eval==0.2.3
Requires-Dist: pycparser==2.23; implementation_name != 'PyPy'
Requires-Dist: pygments==2.19.2
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: pyvips-binary==8.17.3
Requires-Dist: pyvips[binary]==3.0.0
Requires-Dist: pyzmq==27.1.0
Requires-Dist: referencing==0.37.0
Requires-Dist: rich==14.2.0
Requires-Dist: rpds-py==0.28.0
Requires-Dist: six==1.17.0
Requires-Dist: stack-data==0.6.3
Requires-Dist: textual-image[textual]==0.8.4
Requires-Dist: textual[syntax]==6.6.0
Requires-Dist: tornado==6.5.2
Requires-Dist: traitlets==5.14.3
Requires-Dist: tree-sitter-bash==0.25.0
Requires-Dist: tree-sitter-css==0.25.0
Requires-Dist: tree-sitter-go==0.25.0
Requires-Dist: tree-sitter-html==0.23.2
Requires-Dist: tree-sitter-java==0.23.5
Requires-Dist: tree-sitter-javascript==0.25.0
Requires-Dist: tree-sitter-json==0.24.8
Requires-Dist: tree-sitter-markdown==0.5.1
Requires-Dist: tree-sitter-python==0.25.0
Requires-Dist: tree-sitter-regex==0.25.0
Requires-Dist: tree-sitter-rust==0.24.0
Requires-Dist: tree-sitter-sql==0.3.11
Requires-Dist: tree-sitter-toml==0.7.0
Requires-Dist: tree-sitter-xml==0.7.0
Requires-Dist: tree-sitter-yaml==0.7.2
Requires-Dist: tree-sitter==0.25.2
Requires-Dist: typing-extensions==4.15.0
Requires-Dist: uc-micro-py==1.0.3
Requires-Dist: wcwidth==0.2.14
Description-Content-Type: text/markdown

## About

A Jupyter notebook client for your terminal. 
It aims to emulate the functionality of the classic Jupyter notebook.
Built on the excellent [textual](https://github.com/Textualize/textual) framework with image support from [textual-image](https://github.com/lnqs/textual-image).

## Demo

![demo](./docs/images/demo.gif)

## Getting started

The easiest way to get started is with `uv`. To try without installing
```
uvx --from netbook jupyter-netbook [my_notebook.ipynb]
```

To install in the current virtual environment
```
uv pip install netbook
```

Or install it as a standalone tool
```
uv tool install netbook
```

Run it as follows
```
jupyter-netbook [my_notebook.ipynb]
```

## Terminal Support

| Terminal         | Status  | Image Support | Shift/Ctrl+Enter Support | Notes |
|------------------|---------|---------------|--------------------------|-------|
| Kitty            | ✅      | ✅ TGP        | ✅ Out of the box        | Remap some keybindings |
| Foot             | ✅      | ✅ Sixel      | ✅ Out of the box        | Sixel support is flaky |
| Contour          | ✅      | ✅ Sixel      | ✅ Out of the box        |       |
| ITerm2           | ✅      | ✅ Sixel, TGP | ✅ Out of the box        | ITerm2 image protocal would probably be supported in the future |
| Wezterm          | ✅      | ✅ TGP        | ✅ Requires remapping    |       |
| Windows Terminal | ✅      | ✅ Sixel      | ✅ Requires remapping    | Things kind of work, sometimes... | 
| Ghosty           | ✅      | ✅ TGP        | ✅ Out of the box        |       |
| Tmux             | ✅      | ✅ Sixel, TGP | ✅ Requires configuration| See the FAQ on configuration |
| Alacritty        | 🤷      | ❌            | ✅ Requires remapping    | It is quite unlikely that alacritty will support images |
| Zellij           | ❌      | ❌            | ✅ Out of the box        | In theory zellij support sixels, but I couldn't make it work      |

## Frequently asked questions

**Q:** Why are icons in the toolbar all jumbled up?

**A:** You need to have Font Awesome installed. Or you can download [nerd fonts](https://www.nerdfonts.com/) that already have the glyphs patched in.

**Q:** How can I start other kernels?

**A:** You can use `--kernel` argument. It accepts kernel names shown by `jupyter-kernelspec list`.

**Q:** How to see available keybindings?

**A:** Press 'h' in command mode (i.e. when focus is not in a text area). The keybindings are mostly compatible with the classic Jupyter notebook.

**Q:** How to remap the keys in my terminal?

**A:** Here are snippets for a selection of terminal emulators:

  - Kitty. Add the following to `~/.config/kitty/kitty.conf`
    ```
    # Send ctrl+shift+minus to netbook
    map --when-focus-on title:netbook kitty_mod+minus
    ```
  
  - Wezterm. Add the following to `~/.config/wezterm/wezterm.lua`
    ```
    local wezterm = require 'wezterm';

    return {
      -- ...

      keys = {
        {key="Enter", mods="CTRL", action=wezterm.action{SendString="\x1b[13;5u"}},
        {key="Enter", mods="SHIFT", action=wezterm.action{SendString="\x1b[13;2u"}},
        {key="Enter", mods="ALT", action=wezterm.action{SendString="\x1b[13;3u"}},
      },
    }
    ```
  - Windows Terminal. Add the following to `settings.json` file
    ```
    {
      // ...

      "keybindings":
      [
        { "command": { "action": "sendInput", "input": "\u001b[13;5u" }, "keys": "ctrl+enter" },
        { "command": { "action": "sendInput", "input": "\u001b[13;2u" }, "keys": "shift+enter" },
        { "command": { "action": "sendInput", "input": "\u001b[13;3u" }, "keys": "alt+enter" }
      ]
    }
    ```

Euporie, a related project, also has some [examples](https://euporie.readthedocs.io/en/latest/pages/keybindings.html),

**Q:** Images are not showing up.

**A:** Make sure your terminal has support for sixels or terminal graphics protocol. By default netbook autodetects support. If this fails, you can force the protocol using the `--graphics` option.

**Q:** How to configure tmux?

**A:** Here are some options to make the experience with tmux better.

Enable extended keys such as `ctrl+enter` and `shift+enter`:
```
set -g extended-keys always
set -g extended-keys-format csi-u
set -as terminal-features 'xterm*:extkeys'
```

Enable mouse interaction:
```
set -g mouse on
```

Make sure COLORTERM environment variable is properly set. This can be achieved e.g. via:
```
set -g update-environment -r
```

If your terminal supports Terminal Graphic Protocol (aka kitty protocol), then you can use `--graphic tmux-kitty` option in netbook to use the passthrough feature of tmux. As of this writing this works in Kitty, ITerm2 and Ghostty. In order to enable passthrough in tmux, add this to the config:
```
set -g allow-passthrough on
```

## Development

To get set up just run
```
uv sync
uv run jupyter-netbook
```
