Processing Jupyter Notebooks

Export Code Cells Into *.py File

mastersign.datascience.notebook.export_cell_code.export_cell_code(nb_file, py_file=None, tag='production')[source]

Take the source of all code cells, tagged with the given tag, from the given notebook and write them into a Python code file.

Parameters
  • nb_file – A path to a Jupyter Notebook.

  • py_file – A path to a Python script file as target.

  • tag – A tag name for the code cell selection. Defaults to production.

Remove Input from Jupyter Notebook HTML

mastersign.datascience.notebook.remove_input_from_html.remove_input_from_html(file)[source]

Remove input blocks from Jupyter notebook HTML output.

Parameters

file – A path to the HTML file to process.