Skip to main content

Generates a navigable book-like structure to a collection of jupyter notebooks

Project description

NBBinder - Jupyter Notebook Binder

Main Tests Workflow Status Flake8 Lint Test Workflow Status PDF Export Test Workflow Status readthedocs badge

PyPI - Wheel PyPI - Python Version

License: MIT GitHub repo size

NBBinder generates a navigable book-like structure to a collection of Jupyter notebooks.

Table of Contents


The main function in this module is called bind(). It reads a collection of Jupyter notebooks from a given directory and, upon configuration,

  • adds a table of contents to a selected notebook file, with links to the other notebooks;
  • adds a header cell to each notebook, with custom information about the collection of notebooks;
  • adds a badge cell to each notebook, with links to opening the notebooks in different platforms or formats. For instance, on can include a Google Colab badge and a Binder badge, with links to opening each notebook in these cloud computing plataforms (if the notebooks are hosted in, a badge for showing slides as exported with nbconvert, and so on.
  • adds navigator links, at the beggining and at the end of each notebook, with links to traverse to the previous and the next notebook, and to other selected notebooks, such as the Table of Contents and the References;


The most convenient way to use the module, or script, is via a configuration file. The configuration files are written in the YAML format.

Example configuration file

For instance, consider the following config_nb_alice.yml in the tests folder:

# Configuration file for the python module NBBinder

version: 0.12a

path_to_notes: nb_builds/nb_alice

  toc_nb_name: 00.00-Alice's_Adventures_in_Wonderland.ipynb
  toc_title: Table of Contents
  show_index_in_toc: True

header: "NBBinder test on a collection of notebooks named after the chapters of 'Alice's Adventures in Wonderland'"

    - 00.00-Alice's_Adventures_in_Wonderland.ipynb
  show_nb_title_in_nav: False
  show_index_in_nav: False

Notebook collection

The following collection of indexed notebooks is built in the folder tests/nb_builds/nb_alice:


Binding the collection

One way to bind the collection of notebooks is to import the module and use the bind() function with this configuration file as argument:

import nbbinder as nbb

Or we execute it as a script in the command line:

./ config_nb_alice.yml

In the tests directory, the configuration file is actually not in the same folder as the script. The collection is two folders down. This is indicated by the argument path_to_notes: nb_builds/nb_alice, given in the configuration file.


After binding the notebooks in one of the two ways mentioned above, the following table of contents is inserted in the first notebook 00.00-Alice's_Adventures_in_Wonderland.ipynb:

Table of Contents

Alice's Adventures in Wonderland

1. Down the Rabbit-Hole

2. The Pool of Tears

3. A Caucus-Race and a Long Tale

4. The Rabbit Sends in a Little Bill

5. Advice from a Caterpillar

6. Pig and Pepper

7. A Mad Tea-Party

8. The Queen's Croquet-Ground

9. The Mock Turtle's Story

10. The Lobster Quadrille

11. Who Stole the Tarts?

12. Alice's Evidence

See 00.00-Alice's_Adventures_in_Wonderland for the bound version of the first notebook. Notice the header in the begining of the notebook and the navigator cells after the header and at the end of the notebook. Experiment with the navigator links to move to the other notebooks.


After development is complete, the module will be available in PyPI and installation will be possible with

pip install nbbinder

For the moment, it is only available in TestPyPI.

The module can also be downloaded directly from

More information about the installation processes on the Installation section of NBBinder documentation (NOT UP TO DATE)


The documentation of NBBinder is hosted on (NOT UP TO DATE)


During the current alpha stage of the project, development is being done in the master branch, which is currently the only branch in the repository.

When the first beta version is released, the latest stable version will stay in the master branch and development will belong to a separate development branch.




The original work in Python Data Science Handbook/tools is licensed by Jake VanderPlas, under the MIT license.

The current modifications in this module is also provided under the MIT license. See the file LICENSE.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbbinder-0.12a2.tar.gz (13.3 kB view hashes)

Uploaded source

Built Distribution

nbbinder-0.12a2-py3-none-any.whl (13.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page