1

Creating a Python package consists of creating an init module and then having perhaps some other modules in the same level as init or higher to call the package. For example, the following is the structure for package A.

A/
     __init__.py
     A_1.py
Call.py

However, I am wondering if the same thing can be done in Jupyter notebook instead of .py modules.

   A/
         __init__.ipynb
         A_1.ipynp
    Call.ipynb

The motivation behind this is that sometimes you only have access to Jupyter notebook like in SageMaker so wondering how this can be done.

merv
  • 67,214
  • 13
  • 180
  • 245
math
  • 341
  • 4
  • 14
  • 3
    is this relevant https://stackoverflow.com/questions/44116194/import-a-function-from-another-ipynb-file ? – Joran Beasley Jan 22 '22 at 20:20
  • Thank you this is helpful, but I am wondering if people can comment on other techniques and best practices to do this. – math Jan 22 '22 at 20:23

1 Answers1

0

nbdev

  • example: the fastai/fastai package is written entirely in jupyter notebooks! And it uses nbdev

Write, test, document, and distribute software packages and technical articles — all in one place, your notebook.

End-To-End Walkthrough Tutorial: https://nbdev.fast.ai/tutorials/tutorial.html

Vladimir Fokow
  • 3,728
  • 2
  • 5
  • 27