kedro/cli/utils.py
def export_nodes(filepath: Path, output_path: Path) -> None:
    """Copy code from Jupyter cells into nodes in src/<package_name>/nodes/,
    under filename with same name as notebook.

    Args:
        filepath: Path to Jupyter notebook file
        output_path: Path where notebook cells' source code will be exported
    Raises:
        KedroCliError: When provided a filepath that cannot be read as a
            Jupyer notebook and loaded into json format.
    """
    try:
        content = json.loads(filepath.read_text())
    except json.JSONDecodeError:
        raise KedroCliError(f"Provided filepath is not a Jupyter notebook: {filepath}")

    cells = [
        cell
        for cell in content["cells"]
        if cell["cell_type"] == "code" and NODE_TAG in cell["metadata"].get("tags", {})
    ]

    if cells:
        output_path.write_text("")
        for cell in cells:
            _append_source_code(cell, output_path)
    else:
        warn(f"Skipping notebook '{filepath}' - no nodes to export.")
Copy code from Jupyter cells into nodes in src/<package_name>/nodes/,
    under filename with same name as notebook.

    Args:
        filepath: Path to Jupyter notebook file
        output_path: Path where notebook cells' source code will be exported
    Raises:
        KedroCliError: When provided a filepath that cannot be read as a
            Jupyer notebook and loaded into json format.
    
Copy code from Jupyter cells into nodes in src//nodes/,
under filename with same name as notebook.
Copy code from Jupyter cells into nodes in src // nodes / under filename with same name as notebook .
def export_nodes(filepath: Path, output_path: Path) -> None:
    try:
        content = json.loads(filepath.read_text())
    except json.JSONDecodeError:
        raise KedroCliError(f"Provided filepath is not a Jupyter notebook: {filepath}")
    cells = [
        cell
        for cell in content["cells"]
        if cell["cell_type"] == "code" and NODE_TAG in cell["metadata"].get("tags", {})
    ]
    if cells:
        output_path.write_text("")
        for cell in cells:
            _append_source_code(cell, output_path)
    else:
        warn(f"Skipping notebook '{filepath}' - no nodes to export.")
def export_nodes ( filepath : Path , output_path : Path ) -> None : try : content = json . loads ( filepath . read_text ( ) ) except json . JSONDecodeError : raise KedroCliError ( f"Provided filepath is not a Jupyter notebook: {filepath}" ) cells = [ cell for cell in content [ "cells" ] if cell [ "cell_type" ] == "code" and NODE_TAG in cell [ "metadata" ] . get ( "tags" , { } ) ] if cells : output_path . write_text ( "" ) for cell in cells : _append_source_code ( cell , output_path ) else : warn ( f"Skipping notebook '{filepath}' - no nodes to export." )
Copy code from Jupyter cells into nodes in src/<package_name>/nodes/,
under filename with same name as notebook.
Copy code from Jupyter cells into nodes in src / <package_name > / nodes / under filename with same name as notebook .
"""Copy code from Jupyter cells into nodes in src/<package_name>/nodes/,
    under filename with same name as notebook.

    Args:
        filepath: Path to Jupyter notebook file
        output_path: Path where notebook cells' source code will be exported
    Raises:
        KedroCliError: When provided a filepath that cannot be read as a
            Jupyer notebook and loaded into json format.
    """
When provided a filepath that cannot be read as a
Jupyer notebook and loaded into json format.
When provided a filepath that cannot be read as a Jupyer notebook and loaded into json format .
KedroCliError
filepath
Path
Path to Jupyter notebook file
Path to Jupyter notebook file
output_path
Path
Path where notebook cells' source code will be exported
Path where notebook cells ' source code will be exported