Skip to main content

Save and load notebooks to local-storage

Project description

Jupyter Offline Notebook

Binder PyPI

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


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


This extension can be configured in 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.


Offline notebook buttons

There are three new icons to:

  • 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

Saving and loading uses the repository ID and the path of the current notebook. If you don't see the buttons check the Javascritp console log, it may mean no repository ID was found.

See example.ipynb


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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jupyter-offlinenotebook, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size jupyter-offlinenotebook-0.0.8.tar.gz (159.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page