Save and load notebooks to local-storage
Project description
Jupyter Offline Notebook
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. If it is 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
Usage
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 theBINDER_REPO_URL
environment variable.repository_ref_url
: A callable that returns the repository reference URL. Default is the value of theBINDER_REF_URL
environment variable.binder_persistent_url
: A callable that returns the repository reference URL. Default is the values of theBINDER_LAUNCH_HOST
andBINDER_PERSISTENT_REQUEST
environment variables.binder_repo_label
: A callable that returns the label used to link to the repository.
JupyterLab Extension
The JupyterLab extension is still under development. To try it out:
Installation
pip install jupyter-offlinenotebook
jupyter labextension install jupyter-offlinenotebook
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
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.
Jupyter Notebook:
pip install .
Jupyter Lab:
jlpm
jupyter labextension link
Tagged releases of this repository are automatically published to Pypi and NPM by Travis.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file jupyter-offlinenotebook-0.0.11.tar.gz
.
File metadata
- Download URL: jupyter-offlinenotebook-0.0.11.tar.gz
- Upload date:
- Size: 238.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1120665636469dc72128c5dea571afd8e6a47a6aa740bdc233432f9a35581f6b |
|
MD5 | b943ecec25f0d72e58474e0423781d24 |
|
BLAKE2b-256 | c458c342ed4d5352b8efd7acc49c18a2deab804f56d95a886e944d8cf7fcbd01 |