I'm looking for a work flow to extract specific cells from a notebook. If I can tag the cells I want to end up in the final script, how would I extract them?
I've tried nbmanips but it does not work as expected.
I'm looking for a work flow to extract specific cells from a notebook. If I can tag the cells I want to end up in the final script, how would I extract them?
I've tried nbmanips but it does not work as expected.
Figured it out
from nbmanips import Notebook
nb = Notebook.read_ipynb("scratch.ipynb")
nb.select(lambda cell: cell.metadata != {} and 'prod' in cell.metadata.tags).keep()
nb.to_py("prod.py")