Something like pandoc or nbconvert could be used, but figuring out which components are needed and deciphering the respective documentation might be more work than just creating a short script from scratch.
Considering the program's length and the functionality it provides, I'd say writing a custom script was the best choice. See the generate.ipynb notebook and related commits.
Something like pandoc or nbconvert could be used, but figuring out which components are needed and deciphering the respective documentation might be more work than just creating a short script from scratch.