Generates a navigable book-like structure to a collection of jupyter notebooks
NBBinder - Jupyter Notebook Binder
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 github.com), 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 contents: 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'" navigators: core_navigators: - 00.00-Alice's_Adventures_in_Wonderland.ipynb show_nb_title_in_nav: False show_index_in_nav: False
The following collection of indexed notebooks is built in the folder
00.00-Alice's_Adventures_in_Wonderland.ipynb 01.00-Down_the_Rabbit-Hole.ipynb 02.00-The_Pool_of_Tears.ipynb 03.00-A_Caucus-Race_and_a_Long_Tale.ipynb 04.00-The_Rabbit_Sends_in_a_Little_Bill.ipynb 05.00-Advice_from_a_Caterpillar.ipynb 06.00-Pig_and_Pepper.ipynb 07.00-A_Mad_Tea-Party.ipynb 08.00-The_Queen's_Croquet-Ground.ipynb 09.00-The_Mock_Turtle's_Story.ipynb 10.00-The_Lobster_Quadrille.ipynb 11.00-Who_Stole_the_Tarts?.ipynb 12.00-Alice's_Evidence.ipynb
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 nbb.bind('config_nb_alice.yml')
Or we execute it as a script in the command line:
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
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 github.com/rmsrosa/nbbinder.
More information about the installation processes on the Installation section of NBBinder documentation (NOT UP TO DATE)
The documentation of NBBinder is hosted on nbbinder.readthedocs.io. (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
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size nbbinder-0.12a2-py3-none-any.whl (13.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size nbbinder-0.12a2.tar.gz (13.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for nbbinder-0.12a2-py3-none-any.whl