Terminal Images Module

Terminal image rendering utilities for card previews.

simulchip.terminal_images.download_card_image(image_url, max_size=(300, 420))[source]

Download and resize a card image for terminal display.

Parameters:
  • image_url (str) – URL of the card image

  • max_size (tuple[int, int]) – Maximum size (width, height) for the image

Return type:

Optional[Image]

Returns:

PIL Image object or None if download fails

simulchip.terminal_images.render_card_image_terminal(image_url, width=40)[source]

Render a card image as terminal pixels.

Parameters:
  • image_url (str) – URL of the card image to render

  • width (int) – Target width in terminal characters

Return type:

Optional[Pixels]

Returns:

Pixels object for rich display or None if rendering fails

simulchip.terminal_images.get_card_image_url(card_data)[source]

Extract the image URL from card data.

Parameters:

card_data (dict[str, Any]) – Card data dictionary from NetrunnerDB API

Return type:

Optional[str]

Returns:

Image URL string or None if not found

simulchip.terminal_images.display_card_preview(console, card_data, title='', width=30)[source]

Display a card preview image in the terminal.

Parameters:
  • console (Console) – Rich console for output

  • card_data (dict[str, Any]) – Card data from NetrunnerDB API

  • title (str) – Optional title to display above the image

  • width (int) – Width in terminal characters

Return type:

bool

Returns:

True if image was successfully displayed, False otherwise