Metadata-Version: 2.1
Name: nb-thumb
Version: 0.0.5
Summary: Extract thumbnails from Jupyter notebooks
Home-page: https://github.com/fastai/nb-thumb
Author: Hamel Husain
Author-email: hamel.husain@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: nbformat (>=5.7.0)
Requires-Dist: Pillow (>=9.0.0)
Provides-Extra: dev

# nb-thumb

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

<div>

[![](https://github.com/fastai/nb-thumb/actions/workflows/test.yaml/badge.svg)](https://github.com/fastai/nb-thumb/actions/workflows/test.yaml)

</div>

## 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))
```

![](index_files/figure-commonmark/cell-3-output-1.png)

### Show A Gallery

This will show a gallery of plots from notebooks.

``` python
from nb_thumb import gallery
```

<div>

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

</div>

``` 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))
```

![image.png](index_files/figure-commonmark/cell-13-1-f2854a9b-19e7-4f38-ae0b-894462a88e09.png)

## Usage

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


