import mermaid from 'https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.2.3/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true });
Displays JSON in a notebook.
Inspired from Pretty JSON Formatting in IPython Notebook. We use the trick described just above. The only addition is the use of an external library renderjson. The code is here : json_helper.py.
from jyquickhelper import JSONJS JSONJS(dict(name="xavier", city="Paris"), only_html=True, show_to_level=3)
import requests data_json = requests.get("http://api.worldbank.org/countries?incomeLevel=LMC&format=json").json() JSONJS(data_json)