nbless package

Module contents

nbless.nbuild(filenames: List[str]) → nbformat.notebooknode.NotebookNode[source]

Create an unexecuted Jupyter notebook from markdown and code files.

Parameters

filenames – A list of source file names.

nbless.nbexec(nb_name: str, kernel: str = 'python3') → Tuple[str, nbformat.notebooknode.NotebookNode][source]

Create an executed notebook without modifying the input notebook.

Parameters
  • nb_name – The NotebookNode object to be executed.

  • kernel – The programming language used to execute the notebook.

nbless.nbconv(nb_name: str, exporter: str = 'python') → Tuple[str, str][source]

Convert a notebook into various formats using nbformat exporters.

Parameters
  • input_name – The name of the input notebook.

  • exporter – The exporter that determines the output file type.

Note

The exporter type must be ‘asciidoc’, ‘pdf’, ‘html’, ‘latex’, ‘markdown’, ‘python’, ‘rst’, ‘script’, or ‘slides’. pdf requires latex, ‘notebook’ does nothing, slides need to served (not self-contained).

nbless.nbsave(filename: str, nb: nbformat.notebooknode.NotebookNode) → None[source]

Save an nbformat NotebookNode object as an ipynb file.

Parameters
  • filename – The filename of the output notebook.

  • nb – The NotebookNode object to be saved to a file.

nbless.nbread(filename: str) → nbformat.notebooknode.NotebookNode[source]

Read in a notebook file as an nbformat NotebookNode object.

Parameters

filename – The filename of the notebook to be read in.