Argument Parsing#

(nbrefactor.utils.argument_parsing)

Argument Parsing and Handling

parse_args()[source]#

CLI argument parser.

This function defines the following arguments:

Positional arguments:

notebook_path (str): path to the Jupyter Notebook file. output_path (str): path to the output directory where refactored modules will be saved.

Optional arguments:

-rp, –root-package (str): name of the root package. Defaults to the current directory (“.”). -gp, –generate-plot: generate a plot of the module dependency tree. Defaults to False. -pf, –plot-format (str): format of the plot (e.g., “pdf”, “png”). Defaults to “pdf”. -i, –init-files: generate __init__.py files in package directories. Defaults to False.

Returns:

parsed arguments from the command line.

Return type:

argparse.Namespace