Literate Programming using Jupyter Notebook

alpha2phi
3 min readDec 13, 2020

Overview

As developer, I use vim as my code editor for my personal projects, and Visual Studio Code at work. Occasionally I use Emacs as I really like org mode, especially using org babel for reproducible research and literal programming, providing a computing environment for authoring mixed natural and computer language documents.

For those who are not familiar with literate programming, from Wikipedia

Literate programming is a programming paradigm introduced by Donald Knuth in which a computer program is given an explanation of its logic in a natural language, such as English, interspersed with snippets of macros and traditional source code, from which compilable source code can be generated.

For data science projects, I use Jupyter notebook for exploratory data analysis, data preparation, wrangling, training and testing the models and eventually coming out with the final model for production. During this process, sometimes the code I wrote in the notebooks need to be extracted and packaged as a python module or library for further reuse.

I have been using fast.ai library in few of my projects and it is a cool library which make machine learning accessible and easy for everyone to get started. fast.ai library is developed through a notebook approach using nbdev. After watching a recent video by Jeremy I decided to try this approach.

Python Programming using nbdev

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.