Skip to main content

Jupyter notebook for terminal

Project description

About

A Jupyter notebook client for your terminal. It aims to emulate the functionality of the classic Jupyter notebook. Built on the excellent textual framework with image support from textual-image.

Demo

demo

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 ✅ 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 I expect textual support of ghosty to improve
Alacritty 🤷 ✅ Requires remapping It is quite unlikely that alacritty will support images
Tmux 🤷 ✅ Sixel 🤷 Not out of the box Not sure how to remap the key bindings
Zellij ✅ Out of the box Sixels seems to confuse it quite a bit

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 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,

Development

To get set up just run

uv sync
uv run jupyter-netbook

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbook-0.3.2.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbook-0.3.2-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file netbook-0.3.2.tar.gz.

File metadata

  • Download URL: netbook-0.3.2.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for netbook-0.3.2.tar.gz
Algorithm Hash digest
SHA256 97e9861ed8aa28b053ac044ac49555daf292c654745e870eed36b0067c7e5bfe
MD5 1b9402f4ce0a96ace08457bdae378999
BLAKE2b-256 0de645c1a04e9c75d78a08aaac49800e9b154f44ffccb32256a160f72eeaf5c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbook-0.3.2.tar.gz:

Publisher: python-publish.yml on lyovushka/netbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbook-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: netbook-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for netbook-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 093996c34c0d6952b5d61c3a0467043bfdbc6f1e43e89ffcdd751780a7154a4f
MD5 86ff5a74fd63de9c3a7d1a142041fa1b
BLAKE2b-256 30d947431667d2621d8ff0e6351bc12b8a8f89e21838e7404fd40720668fea6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbook-0.3.2-py3-none-any.whl:

Publisher: python-publish.yml on lyovushka/netbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page