Ctrl + k

or run

tessl search
Log in

Version

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

tessl/pypi-ipython

tessl install tessl/pypi-ipython@9.5.0

IPython: Productive Interactive Computing - An advanced interactive computing environment and command shell for Python.

Agent Success

Agent success rate when using this tile

86%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.09x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-8/

Rich Content Viewer

Build a Python module that creates a rich content viewer which can display different types of media content in an IPython/Jupyter environment. The viewer should support HTML snippets, images from various sources, and videos.

Capabilities

Display HTML Content

The viewer should be able to render HTML content.

  • Given an HTML string "<h1>Hello World</h1><p>This is a test.</p>", the viewer displays it as formatted HTML @test
  • Given an HTML table structure with 3 rows and 2 columns, the viewer displays it as a formatted table @test

Display Images from URLs

The viewer should be able to display images from remote URLs.

  • Given a URL to a PNG image, the viewer displays the image @test
  • Given a URL to a JPEG image with a specified width of 300 pixels, the viewer displays the image at that width @test

Display Images from Local Files

The viewer should be able to display images from the local filesystem.

  • Given a path to a local PNG file, the viewer reads and displays the image @test
  • Given a path to a local JPEG file that doesn't exist, the viewer raises an appropriate error @test

Display Video Content

The viewer should be able to embed video content.

  • Given a URL to an MP4 video, the viewer displays an embeddable video player @test
  • Given a URL to an MP4 video with specified width and height (640x480), the viewer displays the video player with those dimensions @test

Implementation

@generates

API

"""
Rich content viewer for IPython/Jupyter environments.
"""

class RichContentViewer:
    """
    A viewer class for displaying various types of rich media content in IPython/Jupyter.
    """

    def display_html(self, html_string: str) -> None:
        """
        Display HTML content.

        Args:
            html_string: HTML string to display
        """
        pass

    def display_image_from_url(self, url: str, width: int = None) -> None:
        """
        Display an image from a URL.

        Args:
            url: URL to the image
            width: Optional width in pixels for the displayed image
        """
        pass

    def display_image_from_file(self, filepath: str) -> None:
        """
        Display an image from a local file.

        Args:
            filepath: Path to the local image file

        Raises:
            FileNotFoundError: If the file does not exist
        """
        pass

    def display_video(self, url: str, width: int = None, height: int = None) -> None:
        """
        Display a video player for the given video URL.

        Args:
            url: URL to the video file
            width: Optional width in pixels for the video player
            height: Optional height in pixels for the video player
        """
        pass

Dependencies { .dependencies }

IPython { .dependency }

Provides rich display capabilities for rendering HTML, images, and videos in interactive environments.

@satisfied-by