Convert Jupyter notebook into web page using fastpages

Jupyter notebook is a huge boon to programmers, particularly who write in Python and are into Data Science. You get to enjoy writing code in a web-based, interactive environment where you have your code along with its output, combined with mathematical expressions, texts, visualisations, images and other rich media. It is really convenient to read so many different stuff of various formats all in one single file.

I'm definitely a fan of Jupyter notebook. I use it to write code for machine learning, play with data, visualise data, plot graphs and what not. Notebooks can easily be shared with people just like any other file but what if you want to create a blog post or an article out of your notebook? The good news is it is possible to convert a notebook into a web page using fastpages. This way your notebook becomes digestible for non-technical people who might otherwise have turned off by the presence of code cells or the need to run the notebook to see the results. There are other tools too like nbinteract, nbconvert and voila but not as cool and fast as fastpages.

fastpages uses GitHub Actions to simplify the process of creating Jekyll blog posts on GitHub Pages from a variety of input formats.

I came to know about this cool stuff when I checked the GitHub repo of a website known as, COVID-19 Dashboards, where you get to see COVID-19 statistics. Each post there has been literally typecasted from a Jupyter notebook into a web page. The most attractive and useful feature for data science enthusiasts is data visualisations made with the Altair library in the notebook remains interactive on the web page.

Check out their GitHub repo to set up the whole thing. You can also watch the video tutorial below.

I absolutely love the way a Jupyter notebook is neatly presented as a web page. I have created a blog to present my notebooks on data science and data visualisation. It is amazing how fastpages does the entire job. Once the fastpages blog is set up, you just need to write your notebook, push it to your blog repo and GitHub actions gets triggered. It converts the notebook and adds a post for it in your blog in around one to two minutes. Pretty fast, right? Try it and let me know your experience in comments below.