CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-mdutils

A comprehensive Python library for programmatically creating and manipulating Markdown files with support for headers, tables, lists, images, links, and text formatting.

80

1.90x
Overview
Eval results
Files

task.mdevals/scenario-9/

Dynamic Report Generator

Create a Python program that generates a formatted Markdown report with a predefined structure but dynamically populated content. The report should be built using a template-first approach where placeholders are created for sections that will be filled in later after data processing.

Requirements

Your program should:

  1. Create a Markdown document with the following structure:

    • A title "System Performance Report"
    • A "Summary" section with a placeholder for summary statistics
    • A "Detailed Metrics" section with a placeholder for a metrics table
    • A "Recommendations" section with a placeholder for recommendation items
    • A "Conclusion" section with regular text
  2. After establishing the structure, populate the placeholders with computed data:

    • The summary statistics placeholder should contain text describing total metrics
    • The metrics table placeholder should contain a formatted table with columns: "Metric Name", "Value", "Status"
    • The recommendations placeholder should contain an unordered list of recommendations
  3. Save the final document as performance_report.md

Test Cases

  • Given metrics data [["CPU Usage", "75%", "Good"], ["Memory", "82%", "Warning"], ["Disk I/O", "45%", "Good"]], the generated report contains a properly formatted table with these three rows under the "Detailed Metrics" section. @test

  • Given the structure is created with placeholders first, and content is added to placeholders later, the final document has the correct order: Title, Summary (with content), Detailed Metrics (with table), Recommendations (with list), and Conclusion. @test

  • The generated file performance_report.md exists and contains valid Markdown with all sections properly populated. @test

Implementation

@generates

API

def generate_report(metrics_data: list, summary_text: str, recommendations: list) -> None:
    """
    Generate a performance report with the given data.

    Args:
        metrics_data: A 2D list where each inner list contains [metric_name, value, status]
        summary_text: Text describing the overall summary
        recommendations: List of recommendation strings

    Creates a file named 'performance_report.md' with the formatted report.
    """
    pass

Dependencies { .dependencies }

mdutils { .dependency }

Provides Markdown file creation and formatting capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-mdutils

tile.json