diff --git a/pyproject.toml b/pyproject.toml index 0e0a006..0fb8f98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "vuegen" dynamic = ["version"] [tool.poetry] -description = "Module to generate automatic web interface reports with visualizations" +description = "VueGen automates the creation of reports from bioinformatics outputs, supporting formats like PDF, HTML, DOCX, ODT, PPTX, Reveal.js, Jupyter notebooks, and Streamlit web applications. Users simply provide a directory with output files and VueGen compiles them into a structured report." authors = ["MoNA group"] license = "MIT" readme = "README.md" diff --git a/src/vuegen/__main__.py b/src/vuegen/__main__.py index 5c853d5..2f2565a 100644 --- a/src/vuegen/__main__.py +++ b/src/vuegen/__main__.py @@ -2,7 +2,7 @@ from pathlib import Path from vuegen import report_generator -from vuegen.utils import get_logger, get_parser +from vuegen.utils import get_logger, get_parser, print_completion_message def main(): @@ -47,6 +47,9 @@ def main(): streamlit_autorun=streamlit_autorun, ) + # Print completion message + print_completion_message(report_type) + if __name__ == "__main__": main() diff --git a/src/vuegen/report_generator.py b/src/vuegen/report_generator.py index db06d10..d5b656c 100644 --- a/src/vuegen/report_generator.py +++ b/src/vuegen/report_generator.py @@ -10,7 +10,7 @@ def get_report( report_type: str, - logger: logging.Logger = get_logger("report"), + logger: logging.Logger = None, config_path: str = None, dir_path: str = None, streamlit_autorun: bool = False, @@ -36,7 +36,11 @@ def get_report( ValueError If neither 'config_path' nor 'directory' is provided. """ - # Initialize the config manager object + # Initialize logger only if it's not provided + if logger is None: + logger = get_logger("report") + + # Create the config manager object config_manager = ConfigManager(logger) if dir_path: diff --git a/src/vuegen/utils.py b/src/vuegen/utils.py index 6c85396..e407d34 100644 --- a/src/vuegen/utils.py +++ b/src/vuegen/utils.py @@ -744,6 +744,46 @@ def get_logger(log_suffix): return logger +def print_completion_message(report_type: str): + """ + Prints a formatted completion message after report generation. + """ + border = "─" * 65 # Creates a separator line + print(f"\n{border}\nšŸŽ‰ Pipeline Execution Complete! šŸŽ‰\n") + + if report_type == "streamlit": + print( + """šŸš€ Streamlit Report Generated! + +šŸ“‚ All scripts to build the Streamlit app are available at: + nf_container_results/streamlit_report/sections + +ā–¶ļø To run the Streamlit app, use the following command: + streamlit run nf_container_results/streamlit_report/sections/report_manager.py + +✨ You can extend the report by adding new files to the input directory or updating the config file. + +šŸ› ļø Advanced users can modify the Python scripts directly in: + nf_container_results/streamlit_report/sections +""" + ) + else: + print( + f"""šŸš€ {report_type.capitalize()} Report Generated! + +šŸ“‚ Your {report_type} report is available at: + nf_container_results/quarto_report + +✨ You can extend the report by adding new files to the input directory or updating the config file. + +šŸ› ļø Advanced users can modify the report template directly in: + nf_container_results/quarto_report/quarto_report.qmd +""" + ) + + print(border) + + ## REPORT FORMATTING def generate_footer() -> str: """