I would like to export the content of a notebook to a .py file using nbdev, but without the necessity to store the notebook in a separate GitHub repo etc. (as described in the full walkthrough). My goal is to have re-useable code in the notebook which I can re-use in other notebooks.
I created a simple “hello world” notebook with 4 cells
Cell1:
# default_exp pkg
Cell2:
# export
class ClassToBeExported:
def __init__(self):
pass
Cell3:
dummy = ClassToBeExported()
Cell4:
# hide
from nbdev.export import nb_export
nb_export('notebook_export_example.ipynb', 'pkg')
Running all 4 cells in my notebook ‘notebook_export_example.ipynb’, however, does not export the notebook.
What am I missing to make this work?
Thanks,
Christian