All Projects → manics → jupyter-offlinenotebook

manics / jupyter-offlinenotebook

Licence: BSD-3-Clause, Apache-2.0 licenses found Licenses found BSD-3-Clause LICENSE Apache-2.0 LICENSE.dexie
Save and load notebooks to local-storage

Programming Languages

python
139335 projects - #7 most used programming language
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to jupyter-offlinenotebook

nbcelltests
Cell-by-cell testing for production Jupyter notebooks in JupyterLab
Stars: ✭ 66 (+69.23%)
Mutual labels:  jupyterlab, jupyter-notebooks, jupyterlab-extension
Awesome Jupyter
A curated list of awesome Jupyter projects, libraries and resources
Stars: ✭ 2,523 (+6369.23%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab-kubeflow-kale
JupyterLab extension to provide a Kubeflow specific left area for Notebooks deployment
Stars: ✭ 17 (-56.41%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab-custom-css
Add custom CSS rules for JupyterLab
Stars: ✭ 32 (-17.95%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyter-extensions
Jupyter extensions for SWAN
Stars: ✭ 56 (+43.59%)
Mutual labels:  jupyter-notebooks, jupyterlab-extension
knowledgelab
KnowledgeRepo + JupyterLab
Stars: ✭ 46 (+17.95%)
Mutual labels:  jupyterlab, jupyterlab-extension
Best Of Jupyter
🏆 A ranked list of awesome Jupyter Notebook, Hub and Lab projects (extensions, kernels, tools). Updated weekly.
Stars: ✭ 200 (+412.82%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyter bokeh
An extension for rendering Bokeh content in JupyterLab notebooks
Stars: ✭ 165 (+323.08%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab voyager
JupyterLab extension visualize data with Voyager
Stars: ✭ 244 (+525.64%)
Mutual labels:  jupyterlab, jupyterlab-extension
theme-cookiecutter
A cookiecutter template to help you make new JupyterLab theme extensions
Stars: ✭ 47 (+20.51%)
Mutual labels:  jupyterlab, jupyterlab-extension
perspective-python
Python APIs for perspective front end
Stars: ✭ 14 (-64.1%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab-vimrc
add a basic vimrc to jupyterlab vim
Stars: ✭ 59 (+51.28%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab Hub
Deprecated: JupyterLab extension for running JupyterLab with JupyterHub
Stars: ✭ 181 (+364.1%)
Mutual labels:  jupyterlab, jupyterlab-extension
rk
The remote Jupyter kernel/kernels administration utility
Stars: ✭ 53 (+35.9%)
Mutual labels:  jupyterlab, jupyter-notebooks
Jupyterlab Go To Definition
Navigate to variable's definition with a click in JupyterLab (or with a few key strokes)
Stars: ✭ 180 (+361.54%)
Mutual labels:  jupyterlab, jupyterlab-extension
Awesome Jupyterlab Extension
😎 A curated list of awesome Jupyterlab extension projects. 🌠 Detailed introduction with images.
Stars: ✭ 198 (+407.69%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab iframe
View html as an embedded iframe in JupyterLab
Stars: ✭ 91 (+133.33%)
Mutual labels:  jupyterlab, jupyterlab-extension
Awesome Jupyterlab
A curated list of awesome JupyterLab extensions and resources
Stars: ✭ 2,035 (+5117.95%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab System Monitor
JupyterLab extension to display system metrics
Stars: ✭ 154 (+294.87%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab templates
Support for jupyter notebook templates in jupyterlab
Stars: ✭ 223 (+471.79%)
Mutual labels:  jupyterlab, jupyterlab-extension

Jupyter Offline Notebook

Binder PyPI npm Build Status

Save and load notebooks to browser storage, even if you've lost your connection to the server.

Installation

pip install jupyter-offlinenotebook

This should automatically enable the extension on Jupyter Notebook and JupyterLab 3.

If you are using JupyterLab 2 you must manually install the JavaScript component of the extension:

jupyter labextension install jupyter-offlinenotebook

This is not needed on JupyterLab 3 due to the new extensions framework that means the JavaScript can be included in the Python pip package.

Usage

Offline notebook buttons

You should see up to five new buttons depending on your configuration and where you are running the notebook:

  • download the in-memory (browser) state of the notebook
  • save the in-memory state of the notebook to local-storage
  • load a notebook from local-storage
  • open the permanent URL of the repository containing this notebook
  • copy the permanent mybinder URL to share this repository

Saving and loading uses the repository ID and the path of the current notebook.

You should always see the Download button. If you are running this on mybinder all buttons should be visible. See the configuration section below to enable the other buttons on other systems.

If you don't see the buttons check the Javascript console log.

See example.ipynb

Configuration

This extension can be configured in jupyter_notebook_config.py by setting the following properties of c.OfflineNotebookConfig:

  • repository_id: A callable that returns the repository ID. This is used when storing and retrieving notebooks. Default is the value of the BINDER_REPO_URL environment variable.
  • repository_ref_url: A callable that returns the repository reference URL. Default is the value of the BINDER_REF_URL environment variable.
  • binder_persistent_url: A callable that returns the repository reference URL. Default is the values of the BINDER_LAUNCH_HOST and BINDER_PERSISTENT_REQUEST environment variables.
  • binder_repo_label: A callable that returns the label used to link to the repository.

Warning

This extension is still in development. It is only tested on Firefox. Breaking changes may occur in future.

There are several major limitations including:

  • Local-storage is limited by quotas imposed by the browser.
  • A repository ID and path of the notebook within Jupyter Notebook are used, joined by a . This may change in future.

Development notes

This extension stores notebooks in browser storage using the IndexedDB API, wrapped with Dexie.js.

One server API call is made during initialisation to obtain the storage configuration. Everything else is done client-side so should work even if the server is disconnected.

The main branch supports both JupyterLab 2 and 3 as well as Jupyter Notebook, but it must be built using JupyterLab 3. This is because the JavaScript assets are compiled using JupyterLab's jlpm command. Install the development dependencies:

pip install -r dev-requirements-jl3.txt

To build and install the development version on Jupyter Notebook and JupyterLab 3:

pip install .

This automatically runs jlpm.

The notebook and server extensions should be automatically enabled. If for some reason it isn't (i.e. it's not listed in jupyter nbextension list or jupyter serverextension list) install and enable it:

jupyter nbextension install --py jupyter_offlinenotebook --sys-prefix
jupyter nbextension enable --py jupyter_offlinenotebook --sys-prefix

jupyter serverextension install --py jupyter_offlinenotebook --sys-prefix
jupyter serverextension enable --py jupyter_offlinenotebook --sys-prefix

JupyterLab 3 supports the installation of extensions as a static package so no further steps are required.

If you are using JupyterLab 2 you must manually install the JavaScript component of the extension:

pip install .
jupyter labextension link

Tagged releases of this repository are automatically published to PyPI and NPM.

To test that the binder and repo buttons work when developing locally set some placeholder environment variables, e.g.:

BINDER_LAUNCH_HOST=http://localhost BINDER_REPO_URL=http://localhost BINDER_PERSISTENT_REQUEST=v2/gh/repo BINDER_REF_URL=http://localhost jupyter-lab --debug

If you make any changes remember to run all linters and auto-formatters:

  • pre-commit run -a
  • jlpm run eslint
  • jlpm run prettier
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].