image

class virtualitics_sdk.elements.image.Image(content, size=ImageSize.MEDIUM, title='', description='', show_title=True, show_description=True, extension='jpeg', raw_image_bytes=False)

Bases: Element

An image to show on an app.

Parameters:
  • content (Image) – The PIL image to show on an app.

  • size (ImageSize) – The size of the image to display, defaults to ImageSize.MEDIUM.

  • title (str) – The title of the element, defaults to ‘’.

  • description (str) – The element’s description, defaults to ‘’.

  • show_title (bool) – Whether to show the title on the page when rendered, defaults to True.

  • show_description (bool) – Whether to show the description to the page when rendered, defaults to True.

EXAMPLE:

# Imports 
from io import BytesIO
from PIL import Image as PILImage
from virtualitics_sdk.elements.image import Image
. . .
# Example usage
class ExampleStep(Step):
  def run(self, flow_metadata):
    . . . 
    jpeg_content = PILImage.open(BytesIO(store_interface.get_s3_asset("ex_path/image/ex.jpg")))
    jpeg_1 = Image(content=jpeg_content, size=ImageSize.SMALL, title="This is a small image")
    jpeg_2 = Image(content=jpeg_content, size=ImageSize.MEDIUM, title="This is a medium image")
    jpeg_3 = Image(content=jpeg_content, size=ImageSize.LARGE, title="This is a large image")
class virtualitics_sdk.elements.image.ImageSize(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

LARGE = 'large'
MEDIUM = 'medium'
SMALL = 'small'