I am brand new to creating modules. I am working with a large Jupyter Lab (JL) file with lots of custom functions. I would like to take those functions, save them in a python file in the same working directory that my JL file is pulling data from, and import them as functions. I don't want to save them to the PIP package manager just yet; I just want to save them as local packages for now.
The functions would be in a .py file in a format similar to this:
def func1(x,y,z):
"""
x = custom input
y = custom imput
z = custom input
"""
do stuff
def func2(x,y,z):
"""
x = custom input
y = custom imput
z = custom input
"""
do stuff
def func3(x,y,z):
"""
x = custom input
y = custom imput
z = custom input
"""
do stuff
def func4(x,y,z):
"""
x = custom input
y = custom imput
z = custom input
"""
do stuff
I would save this in a python file such as "custom_func.py" and save it in the same directory as my JL file.
After saving the python file, what do I need to do so that I can import this as a custom local package? I have seen that you need to do something with __init__.py
, but I'm just not sure what that is.