'Is there a way to make a web app from a jupyter notebook?
I have a jupyter notebook that accepts user-input via the input() python function. It then takes the input and uses it to a run a model and then outputs/plots the result. Is there a way to create a web-app that does this? Of course, the web-app must also accept user-input and have access to my model.
Solution 1:[1]
Someone has already made a plugin for that. Try appmode for Jupyter Notebook. Here's the repository. Hope that works out!
Solution 2:[2]
It doesn't work like that. If you want to make a web app, you'll make GUI with html/css for taking input and displaying output. Your python code will work as the backend of the application. You can use a python framework like flask to make things easier.
Solution 3:[3]
There is a framework called Mercury that can convert Jupyter Notebook into web app by adding YAML header. Please add Raw cell at the the beginning of the notebook:
title: My app title
description: What is your app doing?
params:
my_variable:
input: text
label: Please provide input
In the next cell please add variable with some default value
my_variable = "some text"
Then you can have your Notebook code. The Mercury framework will convert Notebook into web app.
If you would like to hide the code. Just add show-code: False after description in the YAML header and your users will only see outputs.
The Notebook can be easily deployed to the 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 | mekamade |
| Solution 2 | Moosa Saadat |
| Solution 3 |
