nbless package¶
Module contents¶
Nbless: a Python package for programmatic Jupyter notebook workflows.
-
nbless.
nbless
(filenames: List[str], kernel: str = 'python3') → nbformat.notebooknode.NotebookNode[source]¶ Create an executed Jupyter notebook from markdown and code files.
- Parameters
filenames – A list of names of markdown and code files.
kernel – The programming language used to run the notebook.
-
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
(filename: str, kernel: str = 'python3') → Tuple[str, nbformat.notebooknode.NotebookNode][source]¶ Create an executed notebook without modifying the input notebook.
- Parameters
filename – The name of the Jupyter notebook file to be executed.
kernel – The programming language used to execute the notebook.
-
nbless.
nbconv
(filename: str, exporter: str = 'python') → Tuple[str, str][source]¶ Convert a notebook into various formats using
nbformat
exporters.- Parameters
filename – The name of the input notebook file.
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.
nbdeck
(filename: str) → nbformat.notebooknode.NotebookNode[source]¶ Set up a Jupyter notebook to be viewed as or converted into slides.
Sets slide_type to
slide
for markdown cells that start with headers. After runningnbdeck
, you can - view Jupyter notebooks on nbviewer or with the RISE extension - create an HTML slideshow withnbconv
orjupyter nbconvert
.- Parameters
filename – The name of the input Jupyter notebook file.