IPython: Productive Interactive Computing - An advanced interactive computing environment and command shell for Python.
86
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.
The viewer should be able to render HTML content.
"<h1>Hello World</h1><p>This is a test.</p>", the viewer displays it as formatted HTML @testThe viewer should be able to display images from remote URLs.
The viewer should be able to display images from the local filesystem.
The viewer should be able to embed video content.
@generates
"""
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
"""
passProvides rich display capabilities for rendering HTML, images, and videos in interactive environments.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-ipythondocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10