Home

Awesome

<!-- title-start -->

nbpreview light logo nbpreview dark logo

nbpreview

<!-- title-end -->

Checked with mypy PyPI Status Python Version License Read the documentation at https://nbpreview.readthedocs.io/ Tests Codecov pre-commit Black Imports: isort security: bandit

A terminal viewer for Jupyter notebooks. It's like cat for ipynb files.

<!-- github-only -->

Hero image

Documentation

nbpreview's documentation contains a detailed breakdown of its features, command-line usage, and instructions on how to configure the tool.

Requirements

Installation

<!-- installation-start -->

nbpreview can be installed through pipx or pip from PyPI.

pipx provides an easy way to install Python applications in isolated environments. See the documentation for how to install pipx.

% pipx install nbpreview

If pipx is not installed, nbpreview may also be installed via pip:

% python -m pip install nbpreview
<!-- installation-end -->

Features

Syntax highlight code cells

Material theme syntax highlighting

Render markdown

Markdown render

Draw images

Block drawing of image

Render DataFrame

DataFrame render

Create previews for Vega charts

DataFrame render

Render LaTeX

LaTeX render

Parse HTML

HTML render

Create hyperlinks for complex content

Hyperlink renders

Render stderr output

Stderr render

Render tracebacks

Traceback render

Use Nerd Font icons

Try it out

Assuming curl and pipx are installed, nbpreview may be tried out on the terminal by running:

% curl https://raw.githubusercontent.com/paw-lu/nbpreview/main/docs/example_notebook_cells/hero_notebook.ipynb | pipx run nbpreview

Usage

To use nbpreview, type nbpreview into your terminal followed by the path of the notebook you wish to view.

% nbpreview notebook.ipynb

See the command-line reference for details on options.

Contributing

Contributions are very welcome. To learn more, see the contributor guide.

License

Distributed under the terms of the MIT license, nbpreview is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Prior art

Similar tools

<!-- similar-tools-start -->

Thanks to @joouha for maintaining a list of these tools. Many of the projects here were found directly on their page.

<!-- similar-tools-end -->

Complimentary tools

<!-- complimentary-tools-start -->

If you're interested in complimentary tools that help improve the terminal experience for notebooks, there are many amazing projects out there.

<!-- complimentary-tools-end -->

Credits

<!-- credits-start -->

nbpreview relies on a lot of fantastic projects. Check out the dependencies for a complete list of libraries that are leveraged.

Besides the direct dependencies, there are some other projects that directly enabled the development of nbpreview.

<!-- credits-end -->