Preview Images

View image fields inside image documents easily in JSONShower!

JSONShower supports previewing images if they can be rendered in HTML. This is achievable in 1 line of code as shown below:

from jsonshower import show_json

# This is in the same format as search results
documents = [
    {
        "image_url": "https://imgs.xkcd.com/comics/voting.png",
    },
    {
        "image_url": "https://imgs.xkcd.com/comics/animal_songs.png",
    }
]

show_json(
    documents=documents,
    image_fields=["image_url"],     # Image fields
    image_width=200,                # Adjust the image width
)

After running this, you should see the following in your Jupyter Notebook:

xkcd_comics.png
Example showing images