or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/fastcore@1.8.x
tile.json

tessl/pypi-fastcore

tessl install tessl/pypi-fastcore@1.8.0

Python supercharged for fastai development

Agent Success

Agent success rate when using this tile

56%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.37x

Baseline

Agent success rate without this tile

41%

task.mdevals/scenario-9/

HTML Report Generator

Build a Python module that generates structured HTML reports from data dictionaries. The module should create well-formed HTML documents with proper structure, styling, and navigation.

Requirements

Your module should implement a report generator that:

  1. Generates complete HTML documents with proper DOCTYPE, head, and body structure
  2. Creates a navigation menu from a list of section names with anchor links
  3. Builds data tables from lists of dictionaries, with headers derived from dictionary keys
  4. Includes styled sections with titles, paragraphs, and content areas
  5. Converts the HTML structure to a string for output to files or display

Core Functionality

The report generator should accept:

  • A report title
  • A list of section data, where each section contains:
    • A section title
    • A description paragraph
    • Optional tabular data (list of dictionaries)

The output should be a complete, well-formed HTML string.

Test Cases

  • Generating a report with a title and one section containing a description returns valid HTML with proper structure @test
  • Creating a table from a list of dictionaries correctly generates table headers from keys and rows from values @test
  • Building a navigation menu with three section names creates a list with three anchor links @test
  • Generating a complete report with multiple sections and tables produces properly nested HTML @test

Implementation

@generates

API

def generate_report(title: str, sections: list) -> str:
    """
    Generate a complete HTML report from structured data.

    Args:
        title: The main title of the report
        sections: List of section dictionaries, each containing:
            - 'title': Section heading
            - 'description': Section description text
            - 'data': Optional list of dictionaries for table generation

    Returns:
        A string containing the complete HTML document
    """
    pass

def create_table(data: list) -> object:
    """
    Create an HTML table from a list of dictionaries.

    Args:
        data: List of dictionaries with consistent keys

    Returns:
        An HTML table element
    """
    pass

def create_navigation(section_titles: list) -> object:
    """
    Create a navigation menu with anchor links.

    Args:
        section_titles: List of section title strings

    Returns:
        An HTML navigation element
    """
    pass

Dependencies { .dependencies }

fastcore { .dependency }

Provides HTML/XML generation utilities for programmatic document creation.