Remote Hosted, Local Jupyter?!

If you visit the Project Jupyter website you’ll encounter a bunch of “try it in your browser” buttons. If you’ve used Jupyter for a decade or so like me, you probably have also been ignoring these buttons. And if you have clicked on them, you might have been lead to a mybinder.org. Don’t get me wrong, mybinder is cool. It creates a docker image that remote-hosts a live environment so that you can share your interactive notebooks on the web. Cool stuff. But I just found something better.

Have you ever heard of WebAssembly, or wasm as it’s abbreviated? The elevator pitch for WebAssenmbly can be summarized as binary format for a locally runnin, sandboxed JavaScript VM. The idea being that computation can essentially be off-loaded from a remote server to the machine running the browser that’s viewing the website. And you can now probably guess where this is going…

Thanks to wasm, there’s now an online JupyterLab instance featuring a Python kernel and a SQLite kernel. The Python kernel is powered by Pyodide, a WASM port of CPython. While it’s not 1-1 feature complete, it’s quite impressive already. Solve an ODE with SciPy? Data analytics with Pandas? Visualization with Matplotlib? Fancy plots with Bokeh? This instance has got you covered. The governing JupyterLite project is open-source and even includes instructions on how to deploy JupyterLite on GitHub Pages.

What’s wild to me is that yes, you can run this on a GitHub pages instance. Because you don’t actually need a backend, only a static site server, since all computations happen locally. You access your local files when you upload from a local VM, so even though you’re “uploading” you don’t actually need to share your data with the remote server. It’s quite impressive. Again, not everything works 100% yet, but you can get surprisingly far with this setup. You can even get a taste of it without leaving this blog because you can embed a REPL provided by JupyterLite’s demo instance as an iframe. Feel free to play with the REPL below and checkout the JupyterLite project. It’s really cool.

D. Michael Senter
D. Michael Senter
Research Statistician Developer

My research interests include data analytics and missing data.

Related