![]() path = path def load_module ( self, fullname ): """import a notebook as a module""" path = find_notebook ( fullname, self. If all of your notebook cells are pure-Python, this step is unnecessary.Ĭlass NotebookLoader ( object ): """Module Loader for Jupyter Notebooks""" def _init_ ( self, path = None ): self. Since IPython cells can have extended syntax, the IPython transform is applied to turn each of these cells into their pure-Python counterparts before executing them. It’s actually quite simple - once we figure out the filename of the module, all it does is:Įxecute every cell in the Module namespace isfile ( nb_path ): return nb_path Notebook Loader isfile ( nb_path ): return nb_path # let import Notebook_Name find "Notebook Name.ipynb" nb_path = nb_path. ![]() rsplit ( '.', 1 ) if not path : path = for d in path : nb_path = os.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |