PyPI version fury.io PyPI license

CLI Documentation

This is the official documentation for the CLI version of pylabnotebook. All commands explained here have a corresponding function (see API), but I highly reccomend to run this package from the command line, as it was created for.

Installation

Pylabnotebook can be installed via pip in an isolated environment (suggested):

(.venv) $ pip install pylabnotebook

To check the installation:

(.venv) $ labnotebook --version

Warning

Whilst the python dependencies are automatically downloaded and installed, this package highly relies on git. Therefore, there are some git requirements that need to be fullfilled:

  • git version >= 2.40.1, otherwise some functionalities do not work

  • git author and git email set, otherwise the tool cannot create a notebook, as it checks for git author.

Init a notebook

To init a new notebook, just type the following code in any folder of a git directory:

(.venv) $ labnotebook init -n "my project"

A message that confirms the creation of the .labnotebookrc file should appear on the console as stout.

Note

Remember to never change the name of .labnotebookrc file.

Export a notebook

To export the notebook as a single .html file, from the root of the project type:

(.venv) $ labnotebook export -o my_project.html

It will create a my_project.html file with the notebook. You can then share the notebook with peers.

Notebook customization

There are several customization that can be applied to the notebook:

  • you can provide your personal css file by setting it in the .labnotebookrc file in LAB_CSS variable.

  • you can decide to show commits from last to first (default) or from first to last (changing REVERSE_HISTORY variable in .labnotebookrc to True).

  • you can change name and author of the notebook in .labnotebookrc, it will be passed to file when exporting the notebook.