notebook_parsers

Module for parsing whole jupyter notebooks.

This utilizes flake8_nb.parser.cell_parsers.

Functions

Summary

convert_source_line

Transform jupyter magic commands to valid python code.

create_intermediate_py_file

Parse a notebook at notebook_path and saves a parsed version.

create_temp_path

Create the path for a parsed jupyter notebook.

get_notebook_code_cells

Parse a notebook and returns a Tuple.

get_rel_paths

Transform file_paths in a list of paths relative to base_path.

ignore_cell

Return True if the cell isn't a code cell or is empty.

is_parent_dir

Check if a given dir parent_dir is parent directory of path.

map_intermediate_to_input

Map intermediate file lines to notebook cell and line.

read_notebook_to_cells

Parse the notebook at notebook_path as Json and returns a list of notebook cells.

Classes

Summary

NotebookParser

Main parsing class for notebooks.

Exceptions

Exception Summary

InvalidNotebookWarning

Warning that is given when a jupyter notebook can't be parsed as JSON.