nimblebox logo
Docs
v2.1.0

nbox.lib.notebook

Jupyter Notebooks are user by millions of developers world wide, so we said why not just create an operator that runs the jupyter notebook and creates a python file out of it. Catch: Currently we do not support notebooks that have a ! for shell commands, please replace them with subprocess.call(shelex.split(<com>))

Example:

from nbox.lib.notebook import NotebookRunner
op = NotebookRunner("./sample.ipynb")
op() # call and it will do the rest

Functions

iconfunctionget_py_builtin_all
[source]
iconfunctionget_package_version
[source]
iconfunctionprocess_codeblocks
[source]

This function is responsible for unpacking the code blocks and creating the python file from it.

iconfunctionnb2script
[source]
(nb:str,path:str)
Parameters
  • nb -

    path to the notebook file

  • path -

    path to the python file to be created, if None same name as notebook

This function takes in a notebook file and creates a python file from it.

iconfunctionupdate_requirements
[source]

Classes

iconclassImportNodeVisitor
[source]
iconfunction__init__
[source]
iconfunctionvisit_Import
[source]
iconfunctionvisit_ImportFrom
[source]
iconclassNotebookRunner
[source]
iconfunction__init__
[source]
(nb:str,outfile:str)
Parameters
  • nb -

    path to the notebook file

  • outfile -

    path to the python file to be created

Run any notebook as a python file.

iconfunctionforward
[source]
nbox SDKnbox provides built in access to all the APIs and packages them in the most user friendly manner.Star 0