Skip to main content

nbv

Read-only Jupyter Notebook viewing in the terminal or web browser.

Invoking

nbv notebook.ipynb

renders the notebook in the terminal using Rich when connected to an interactive terminal, or as strict plain text (no ANSI escape codes) when piped or redirected.

  • The notebook can also be an http:// or https:// URL. It is downloaded to a temporary file that is removed when nbv exits (--cleanup also removes any leftovers), and GitHub blob links are converted to raw links automatically.
  • Use --plain/--no-rich to force plain text output in a terminal, or --rich to force Rich ANSI output when piping (e.g. nbv --rich notebook.ipynb | less -R).
  • If textual-image is installed, embedded images are displayed directly in the terminal (using Sixel or Kitty's Terminal Graphics Protocol when supported, falling back to colored half-cell blocks); otherwise image dimensions (e.g. [image/png: 640x480]) are shown.
  • Use --images (auto, sixel, tgp, halfcell, unicode, dims, none) to control how images are displayed.
  • Use --theme to choose the syntax highlighting theme: dark (the default) or light, which use the terminal's own ANSI colors (Rich's ansi_dark/ansi_light), or any other Rich/Pygments style name (e.g. monokai).
  • Use --tui to browse the notebook in a scrollable full-screen Textual viewer (requires nbv[tui]; keys: arrows/j/k, space/b, g/G, q). Images are rendered with textual-image's Textual widgets; note that Sixel images can flicker while scrolling. Set NBV_TUI_SCROLL_DELAY (seconds, e.g. 0.2) to hide images while scrolling and show them again once it pauses, which avoids the flicker. Images are rescaled when the terminal is resized; set NBV_TUI_RESIZE_DELAY (same units) to wait until resizing pauses.

Web browser mode (--web)

Invoking

nbv --web notebook.ipynb

converts the notebook to HTML1 using nbconvert and opens this HTML file in the default web browser.

You can get a similar result with just

nbconvert notebook.ipynb --to html --post serve

Note that this (and nbv) doesn't require a full Jupyter installation (e.g. JupyterLab) in order to run. But nbv --web has additional benefits2:

  • doesn't pollute the notebook location with HTML (unlike the above)
  • no server, just open the HTML file in browser
  • simple CLI, exposing only a few nbconvert options

Note: nbv --web will use the nbconvert library if installed, otherwise it will fall back to the jupyter-nbconvert command.

uv examples

Terminal viewing (image dimensions fallback):

uvx nbv notebook.ipynb

Terminal viewing with image rendering (textual-image):

uvx --from 'nbv[image]' nbv notebook.ipynb

Terminal viewing with image rendering and scrollable viewer:

uvx --from 'nbv[tui]' nbv --tui notebook.ipynb

Web browser viewing (nbconvert library):

uvx --from 'nbv[web]' nbv --web notebook.ipynb

All optional dependencies (textual-image, nbconvert, ipython):

uvx --from 'nbv[complete]' nbv notebook.ipynb
uv tool install 'nbv[complete]'

  1. Inside the OS temporary directory by default. The file is left in place for the browser to read, so use --cleanup to remove old ones. ↩

  2. Also I wanted to try Typer. ↩

Metadata

Release files for nbv 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbv 0.2.0
File Size Uploaded Provenance Actions
nbv-0.2.0.tar.gz 14.8 kB Without provenance Details for nbv-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nbv 0.2.0
File Interpreter ABI Platform Actions
nbv-0.2.0-py3-none-any.whl Python 3 none any Details for nbv-0.2.0-py3-none-any.whl

Total release size: 28.9 kB

Release files / nbv-0.2.0.tar.gz

Download URL nbv-0.2.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aa5c3bd33c70cf13c079e852329855c5503f6e47437e983037ac290276475d7c
BLAKE2b-256 checksum
How to use checksums
54219f56937383a6214fe03fd09fe3039f5185327dd0d28fd23a6a3ff521a545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / nbv-0.2.0-py3-none-any.whl

Download URL nbv-0.2.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a3307737a6f81e10edf419e7bd8859a562541c843229937fc53bb375001fd9c
BLAKE2b-256 checksum
How to use checksums
bb7e080a2dada605043bda7c726fdc2a69d28ad4424b274c24b60d6eb5ca7431
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for nbv 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page