Parser#
(nbrefactor.processor.parser)
Parsing methods for both code and markdown cells in a notebook
- parse_code_cell(cell_idx, source, module_node)[source]#
Parses a code cell into a ParsedCodeCell object.
- Parameters:
cell_idx (int) – index of the cell in the notebook.
source (str) – the cell’s index in the notebook.
module_node (
ModuleNode) – the module node in the built module tree
- Returns:
a parsed code cell object with analyzed imports, definitions, usages, etc.
- Return type: