Jupyter, Notebook.
you can rearrange the cells and then run all cells like this: import asyncio from nbterm import Notebook nb = Notebook("my_notebook.ipynb") nb.cut_cell(3) nb.paste_cell(1) asyncio.run(nb.run_all()) nb.save() A lightweight Jupyter stack While you probably can’t tell the difference, nbterm doesn’t