Skip to main content

An utility that extends Jupytext. Allows to auto-refresh browser when source file is changed.

Project description

Jupyter Browser Reload

Flow-saving tool that automatically reloads Jupyter Notebook in a browser when its source .py file is changed and executes all changed cells.

It uses

  • Jupytext - to synchronize .ipynb and .py files
  • Watchdog - to watch for .py file changes
  • Selenium - to have a full control over a browser with opened Jupyter Notebook

Why Jure

Jupytext is a great tool that for instance allows user to benefit from static code analysis of Jupyter Notebooks. However I always struggled with this workflow: after each edit of .py file I needed to manually reload browser and execute all changed cells.

standard

Jure automatically reloads browser on each .py file change, so it would instantly show actual notebook content. Additionally it scrolls to last changed cell and executes all cells that were changed.

with jure

Installation

The most non-trivial part is install ChromeDriver on you computer, here's sample link for Ubuntu for reference. After that it's simply

pip install jure

Usage

First, you need to sync your .ipynb file with .py with Jupytext, see official manual.

Then launch a Jupyter Notebook server (jupyter notebook ...).

Then run

jure --token=[TOKEN] --jupyter_root_dir=[ROOT_DIR] --notebook_path=[NOTEBOOK_PATH]

Where [TOKEN] as an access token which is required to access Jupyter Notebook from browser, [ROOT_DIR] is a path to directory from which jupyter notebook ... command was executed and [NOTEBOOK_PATH] is a path to the notebook .ipynb file you'll work with.

Limitations

This is an experimental and unstable product, any issues, suggestions, feature requests and PRs are appreciated. Current problems:

  • Only Google Chrome web browser is supported
  • Selenium might be inconvenient
  • No password auth / remote notebook hosts
  • In some rare cases user needs to reload browser tab manually
  • For large notebooks page reload might be too slow (tough one)

Project details


Download files

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

Source Distribution

jure-0.3.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

jure-0.3.1-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page