Skip to content

💡  Jupyterlite

Submitted by Rahul Chauhan

Summary

Add a Jupyterlite sandbox to your Streamlit app in one command

Functions

jupyterlite

Add a Jupyterlite sandbox to your Streamlit app

Parameters:

Name Type Description Default
height int

Height of the Jupyterlite sandbox. Default value is 600.

600
width int

Width of the Jupyterlite sandbox. Default value is 800

800
Source code in src/streamlit_extras/jupyterlite/__init__.py
@extra
def jupyterlite(height: int = 600, width: int = 800):
    """
    Add a Jupyterlite sandbox to your Streamlit app

    Args:
        height (int): Height of the Jupyterlite sandbox. Default value is 600.
        width (int): Width of the Jupyterlite sandbox.  Default value is 800
    """

    iframe(
        src="https://jupyterlite.github.io/demo/repl/index.html?kernel=python&toolbar=1",
        height=height,
        width=width,
    )

Import:

from streamlit_extras.jupyterlite import jupyterlite # (1)!
  1. You should add this to the top of your .py file 🛠

Examples

example

def example():
    jupyterlite(1500, 1600)
Output (beta)