cat for jupyter notebooks
Project description
nbcat: Jupyter notebooks viewer
nbcat let you preview Jupyter notebooks directly in your terminal. Think of it as cat, but for .ipynb files.
Features
- Very fast and lightweight with minimal dependencies.
- Preview remote notebooks without downloading them.
- Enable paginated view mode with keyboard navigation (similar to
less). - Supports image rendering in high resolution
- Supports for all Jupyter notebook versions, including old legacy formats.
Motivation
The idea of previewing notebooks in a terminal is not new - there have been many previous attempts to achieve it.
However, most are either slow and overengineered with a ton of half-working features, or they're outdated and incompatible with modern Python.
I was looking for a simple tool that let me quickly render Jupyter notebooks without switching context from my terminal window or installing a ton of dependencies.
Please note, that nbcat doesn't aim to replace JupyterLab. If you need a full-featured terminal experience, I recommend checking out euporie instead.
Installation
# Install from PyPI (recommended)
$ pip install nbcat
# Install via Homebrew
$ brew tab akopdev/formulas/nbcat
$ brew install nbcat
Quickstart
$ nbcat notebook.ipynb
You can pass URLs as well.
$ nbcat https://raw.githubusercontent.com/akopdev/nbcat/refs/heads/main/tests/assets/test4.ipynb
In most cases system less will render images in low resolution. Consider using an internal pager instead:
$ nbcat notebook.ipynb --page
Integrations
nbcat is designed to integrate seamlessly with other tools. Here are a few examples of how easily it can be done.
FZF (Fuzzy finder)
List all .ipynb files and use nbcat to preview them:
find . -type f -name "*.ipynb" | fzf --preview 'nbcat {}'
Ranger
To enable previews in Ranger, add the ipynb extension to the handle_extension function in ~/.config/ranger/scope.sh:
...
handle_extension() {
case "${FILE_EXTENSION_LOWER}" in
ipynb)
nbcat "${FILE_PATH}" && exit 5
exit 1;;
...
Testing & Development
Run the tests:
make test
Check code quality:
make format lint
Contributing
Contributions are welcome! Please open an issue or pull request.
License
Distributed under the MIT License. See LICENSE for more information.
Useful Links
- 📘 Documentation: coming soon
- 🐛 Issues: GitHub Issues
- 🚀 Releases: GitHub Releases
Made with ❤️ by Akop Kesheshyan
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbcat-1.0.0.tar.gz.
File metadata
- Download URL: nbcat-1.0.0.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b039b7d75ea0da3deee8796e3f30b4a1b4c3cf3d5decac197b201e0090b5b6d
|
|
| MD5 |
1d133ee3bb1b7bf55a9cb7704e6f4da2
|
|
| BLAKE2b-256 |
7af0928e7337b2c9c5f38426c592608d21b5fba19cacb7fc6c76e40a7ac4c176
|
Provenance
The following attestation bundles were made for nbcat-1.0.0.tar.gz:
Publisher:
ci.yml on akopdev/nbcat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbcat-1.0.0.tar.gz -
Subject digest:
6b039b7d75ea0da3deee8796e3f30b4a1b4c3cf3d5decac197b201e0090b5b6d - Sigstore transparency entry: 213690749
- Sigstore integration time:
-
Permalink:
akopdev/nbcat@77c3501e11e9456b00fdd4aa2d5e69669ed3223e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/akopdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@77c3501e11e9456b00fdd4aa2d5e69669ed3223e -
Trigger Event:
push
-
Statement type:
File details
Details for the file nbcat-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nbcat-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94d078814bbc806d3316b38f245d38aa73b19ef8fa80b58beb426efaebea50b5
|
|
| MD5 |
b4de92a220d3c746b246cc1d001b1b46
|
|
| BLAKE2b-256 |
b3aa63d0923cd1e4177c15ce10feda7a975e5b796477a606459f8bf4481c9146
|
Provenance
The following attestation bundles were made for nbcat-1.0.0-py3-none-any.whl:
Publisher:
ci.yml on akopdev/nbcat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbcat-1.0.0-py3-none-any.whl -
Subject digest:
94d078814bbc806d3316b38f245d38aa73b19ef8fa80b58beb426efaebea50b5 - Sigstore transparency entry: 213690753
- Sigstore integration time:
-
Permalink:
akopdev/nbcat@77c3501e11e9456b00fdd4aa2d5e69669ed3223e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/akopdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@77c3501e11e9456b00fdd4aa2d5e69669ed3223e -
Trigger Event:
push
-
Statement type: