'How to serve an interactive jupyter notebook cell via desktop or web app?

I'm aware of similar previous questions such as:

What is the easiest way to create a webapp from an interactive Jupyter Notebook?

Exporting Interactive Jupyter Notebook to html

However they are old and outdated (for example dashboards_bundlers is no longer supported...)

Is there any recent progress allowing to turn an interactive notebook into a web/desktop app easily?



Solution 1:[1]

There is a framework Mercury that allows to easily convert the notebook to web application. You need to add the YAML header as RAW cell to your notebook.

The example notebook:

---
title: My app
description: My first notebook shared on Mercury
params:
    greetings:
        input: select
        label: Select greetings
        value: Cze??
        choices: [Cze??, Hello, Hi, Salut, Ciao]
    year:
        input: slider
        label: Select year
        value: 2022
        min: 2021
        max: 2030
---
greetings = "Cze??"
year = 2022
print(f"{greetings} {year}")

The above notebook will generate a web app like in the screenshot below: Mercury example app

There is an option to hide the code and only show the output to non-programming users.

The Mercury is built on top of Django, can be easily deployed to any server/cloud.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pplonski