Links

Save file ipynb

Tags: #jupyternotebooks #naas #jupyter-notebooks #save #snippet #operations
Author: Florent Ravenel
Description: This notebook allows users to save their work in an interactive, web-based format (.ipynb).

Input

Import libraries

import json
from pprint import pprint

Variables

# Input
notebook_path = "../template.ipynb"
# Output
notebook_output = "new_template.ipynb"

Model

Open file

with open(notebook_path) as f:
nb = json.load(f)

Save file

with open(notebook_output, "w") as f:
json.dump(nb, f)

Output

Display result

pprint(nb)