Refactoring legacy notebooks

If you already have notebooks that you wish to convert into maintainable Ploomber pipelines, we developed Soorgeon, a command-line tool that takes a Jupyter notebook as input and outputs a Ploomber pipeline, that is, a pipeline.yaml and one .py file per section in the notebook.

Here’s an example:

# install packages
pip install soorgeon ploomber

# get the example's code
git clone https://github.com/ploomber/soorgeon

# refactor the sample ML notebook
cd examples/machine-learning
soorgeon refactor nb.ipynb

# run the auto-generated Ploomber pipeline
ploomber build

Soorgeon

To install Soorgeon:

pip install soorgeon

Running Soorgeon is as simple as:

soorgeon refactor nb.ipynb

Refactoring guide

We’ve published in our blog a detailed guide to refactoring notebooks:

  1. Part I

  2. Part II