https://github.com/fastai/nb-thumb
Extract thumbnails from Jupyter notebooks
https://github.com/fastai/nb-thumb
Last synced: 5 months ago
JSON representation
Extract thumbnails from Jupyter notebooks
- Host: GitHub
- URL: https://github.com/fastai/nb-thumb
- Owner: fastai
- License: apache-2.0
- Created: 2023-07-14T03:44:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-23T16:44:23.000Z (over 2 years ago)
- Last Synced: 2025-08-24T14:43:59.800Z (5 months ago)
- Language: Jupyter Notebook
- Homepage: https://fastai.github.io/nb-thumb
- Size: 6.04 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nb-thumb
[](https://github.com/fastai/nb-thumb/actions/workflows/test.yaml)
## Install
``` sh
pip install nb_thumb
```
## Quickstart
### Show A thumbnail
``` python
from nb_thumb import nb2thumb
```
``` python
nb2thumb(nb_path='test_nbs/geom_col.ipynb',
label='two_variable_bar_plot',
size=(200,200))
```

### Show A Gallery
This will show a gallery of plots from notebooks.
``` python
from nb_thumb import gallery
```
> **Use output: asis**
>
> When using `nb_thumb.gallery` you should always set the Quarto
> directive `#|output: asis` so that the markdown is rendered correctly
> in quarto.
>
> See [raw
> output](https://quarto.org/docs/computations/execution-options.html#raw-output)
> for more information.
``` python
plots = \
[dict(nb_path= 'test_nbs/geom_col.ipynb', label='two_variable_bar_plot'),
dict(nb_path='test_nbs/PlotnineAnimation.ipynb', label='spiral'),
dict(nb_path='test_nbs/geom_density.ipynb', label='density_curve'),
dict(nb_path='test_nbs/geom_map.ipynb', label='map'),
dict(nb_path='test_nbs/geom_segment.ipynb', label='ranges'),
dict(nb_path='test_nbs/geom_segment.ipynb', label='rank')]
```
``` python
#|output: asis
print(gallery(plots))
```

## Usage
For more information and examples, see [the
docs](https://fastai.github.io/nb-thumb/).