JSON
It displays JSON in the Jupyter Notebooks with interactive collapsible viewer.
import mercury as mr
# example JSON
data = {
"firstKey": ["a", "b", "c"],
"secondKey": [1, 2, 3, 4],
"thirdKey": "Hello World!"
}
# display JSON
mr.JSON(json_data=data, level=1)
# shorter form
mr.JSON(data)
Parameters
- json_data (dict or lit) - data to be displayed, it should be
dict
but it will work withlist
as well. - level (integer) - how many levels display initially. User can interact with displayed data by clicking
+
and-
buttons.
Most of the components in the Mercury frameworks are classes, however JSON
is a function.