Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oschuett/appmode
A Jupyter extensions that turns notebooks into web applications.
https://github.com/oschuett/appmode
Last synced: about 1 month ago
JSON representation
A Jupyter extensions that turns notebooks into web applications.
- Host: GitHub
- URL: https://github.com/oschuett/appmode
- Owner: oschuett
- License: mit
- Created: 2017-03-17T13:33:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T17:38:04.000Z (7 months ago)
- Last Synced: 2024-10-14T06:09:41.999Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 830 KB
- Stars: 461
- Watchers: 23
- Forks: 70
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-earthobservation - appmode - A Jupyter extensions that turns notebooks into web applications. (Language based EO Libraries / Jupyter notebooks librairies)
- awesome-jupyter-resources - GitHub - 7% open · ⏱️ 26.04.2021): (Jupyter拓展)
- best-of-jupyter - GitHub - 5% open · ⏱️ 12.05.2024): (Jupyter Extensions)
- jimsghstars - oschuett/appmode - A Jupyter extensions that turns notebooks into web applications. (JavaScript)
README
# Appmode
**A Jupyter extensions that turns notebooks into web applications.**
![screenshots](./screenshots.png)
## Try it live
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/oschuett/appmode/master?urlpath=%2Fapps%2Fexample_app.ipynb)
Click the binder badge to try it live without installing anything. This will take you directly to the "app" version of the notebook.
## Installation
[![Conda](https://img.shields.io/conda/vn/conda-forge/appmode)](https://anaconda.org/conda-forge/appmode)
If you use `conda`, you can install it as:
```
conda install --channel conda-forge appmode
```[![PyPI](https://img.shields.io/pypi/v/appmode?label=pypi)](https://pypi.org/project/appmode/)
If you use ``pip``, you can install it as:
```
pip install appmode
jupyter nbclassic-extension enable --py --sys-prefix appmode
jupyter server extension enable --py --sys-prefix appmode
```If you want to use [mybinder](https://mybinder.org) add the following `environment.yml` file to your repository:
```
channels:
- conda-forge
dependencies:
- appmode
```## Description
Appmode consist of a server-side and a notebook extension for Jupyter. Together these two extensions provide the following features:
- One can view any notebook in appmode by clicking on the *Appmode* button in the toolbar. Alternatively one can change the url from ``baseurl/notebooks/foo.ipynb`` to ``baseurl/apps/foo.ipynb``. This also allows for direct links into appmode.
- When a notebook is opened in appmode, all code cells are automatically executed. In order to present a clean UI, all code cells are hidden and the markdown cells are read-only.
- A notebook can be opened multiple times in appmode without interference. This is achieved by creating temporary copies of the notebook for each active appmode view. Each appmode view has its dedicated ipython kernel. When an appmode page is closed the kernel is shutdown and the temporary copy gets removed.
- To allow for passing information between notebooks via url parameters, the current url is injected into the variable ``jupyter_notebook_url``.
## Server Side Configuration
Appmode adds the following [configuration options](https://jupyter-notebook.readthedocs.io/en/stable/config.html):
- `Appmode.trusted_path` Run only notebooks below this path in Appmode. Default: No restrictions.
- `Appmode.show_edit_button` Show _Edit App_ button during Appmode. Default: True.
- `Appmode.show_other_buttons` Show other buttons, e.g. Logout, during Appmode. Default: True.
- `Appmode.temp_dir` Create temp notebooks under this directory. Default: Same directory as current notebookWriting hidden files is by default disabled in newer versions of Jupyter.
To allow Appmode to hide its temporary notebook copies the option `ContentsManager.allow_hidden` has to be set:
```
jupyter notebook --ContentsManager.allow_hidden=True
```## Client Side Customization
The UI elements of Appmode can be customized via the [custom.js](http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/JavaScript%20Notebook%20Extensions.html#custom.js) file. Some examples are:
```
$('#appmode-leave').hide(); // Hides the edit app button.
$('#appmode-busy').hide(); // Hides the kernel busy indicator.
$('#appmode-loader').append('Loading...
'); // Adds a loading message.
```
Beware that hiding the edit button does not prevent users from leaving Appmode by changing the URL manually.## Development
With the included [Dockerfile](./Dockerfile) a development environment can be quickly created:
1. Install [Docker](https://docs.docker.com/engine/installation/).
2. git clone this repository
3. `docker build --tag appmode_dev ./`
4. `docker run --init -ti -p127.0.0.1:8888:8888 appmode_dev`
5. Browse to `http://localhost:8888/apps/example_app.ipynb`## Acknowledgements
Appmode has been developed with the support of the [NCCR MARVEL](http://nccr-marvel.ch/) funded by the Swiss National Science Foundation.