See Importing Jupyter Notebooks as Modules for more information.
from znipy import NotebookLoader
module = NotebookLoader().load_module("JupyterNotebook.ipnyb")
hello_world = module.HelloWorld()
or with direct imports
import znipy
znipy.register()
from JupyterNotebook import HelloWorld
hello_world = HelloWorld()