from pathlib import Path
import json


def read_jupyter_as_json(filepath: Path) -> Path:
    """
    Read in rendered notebook-- read in the JSON representation that is 'under
    the hood'
    :param filepath:    path to jupyter notebook.
    """
    with open(filepath, "r") as fout:
        contents = fout.read()

    return json.loads(contents)