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.1

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.1
File Size Uploaded Provenance Actions
nbv-0.2.1.tar.gz 14.9 kB Without provenance Details for nbv-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 29.2 kB

Release files / nbv-0.2.1.tar.gz

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

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

Download URL nbv-0.2.1-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bffca1fb01b21dd20a39541d3dfe79d28bf09ad25057b8fbb28b54920f9ac96
BLAKE2b-256 checksum
How to use checksums
227cdbd35452d6ff773287dbbbf7227d9e2a80272ce2c9dc334617299eb16c93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for nbv 0.2.1

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