coming late to this but … you can import python files into a notebook, but be careful to reimport them each time you modify the source python files.
I have code to do this each time like this:
from cases import datelib_spec
import importlib
importlib.reload(datelib_spec) # every run