3. Zeppelin to Jupyter Notebook

3.1. Basic Functions

3.1.1. mkdir

ze2nb.ze2nb.mkdir(path)[source]

Make a new directory

Parameters:path – the directory path
Author:Wenqiang Feng
Email:von198@gmail.com

3.1.2. file_load

ze2nb.ze2nb.file_load(file_name)[source]

load zeppelin .json file

Parameters:file_name – the input .json file name
Returns:encoded text content from .json file
Author:Wenqiang Feng
Email:von198@gmail.com

3.1.3. table_cell_to_html

ze2nb.ze2nb.table_cell_to_html(cell)[source]

Formats a cell from a Zeppelin TABLE as HTML.

Parameters:cell – cell from Zeppelin
Returns:zeppelin TABLE as HTML
Author:Ryan Blue
Github:https://github.com/rdblue

3.1.4. table_to_html

ze2nb.ze2nb.table_to_html(tsv)[source]

Formats the tab-separated content of a Zeppelin TABLE as HTML.

Parameters:cell – cell from Zeppelin
Returns:zeppelin TABLE as HTML
Author:Ryan Blue
Github:https://github.com/rdblue

3.1.5. convert_parsed

ze2nb.ze2nb.convert_parsed(zeppelin_note)[source]

Converts a Zeppelin note from parsed JSON to a Jupyter Notebook.

Parameters:zeppelin_note – encoded JSON file
Return notebook_name:
 the JSON notebook name
Return notebook_name:
 the parsed Jupyter notebook content
Author:Ryan Blue and Wenqiang Feng
Github:https://github.com/rdblue
Email:von198@gmail.com

3.1.6. write_notebook

ze2nb.ze2nb.write_notebook(notebook_name, notebook, out_path=None)[source]

Writes parsed JSON notebook to a Jupyter notebook .ipynb file from the notebook name.

Parameters:
  • notebook_name – JSON notebook name and output Jupyter notebook name
  • notebook – parsed JSON notebook contents
  • out_path – Jupyter notebook output path, the default output path is current directory.
Author:

Wenqiang Feng and Ryan Blue

Email:

von198@gmail.com

Github:

https://github.com/rdblue

3.2. ze2nb

ze2nb.ze2nb.ze2nb(file_name, load_path=None, out_path=None, to_nb=True, to_html=True, to_py=True)[source]
Parameters:
  • file_name – the input JSON file name
  • load_path – the load path for the input JSON file
  • out_path – the output path for the converted files
  • to_nb – the flag for keeping .ipynb
  • to_html – the flag for converting to .html
  • to_py – the flag for converting to .py
Author:

Wenqiang Feng and Ryan Blue

Email:

von198@gmail.com

Github:

https://github.com/rdblue