extract_source_code Module#
extract_source_code.py
This module provides utilities for cleaning up project directories by removing unwanted files and directories, and clearing Jupyter Notebook outputs.
- utils.extract_source_code.clean_directory(target_dir: str) None[source]#
Walks the directory to clean files, remove folders, and clear notebooks.
- Parameters:
target_dir (str) – The root directory to start cleaning from.
- utils.extract_source_code.clear_jupyter_outputs(file_path: str) None[source]#
Parses a Jupyter Notebook as JSON and clears cell outputs/execution counts.
- Parameters:
file_path (str) – The path to the Jupyter Notebook file.
- utils.extract_source_code.contains_template_html(dir_path: str) bool[source]#
Checks if a directory recursively contains any ‘template.html’ file.