A JupyterLab and Jupyter Notebook extension for rendering JSON Table Schema
- JupyterLab >=0.11.0 and/or Notebook >=4.3
To render JSONTable output in IPython:
from jupyterlab_table import JSONTable
JSONTable({
"schema": {
"fields": [
{
"type": "any",
"name": "Date"
},
{
"type": "number",
"name": "Open"
},
{
"type": "number",
"name": "High"
},
{
"type": "number",
"name": "Low"
},
{
"type": "number",
"name": "Close"
},
{
"type": "integer",
"name": "Volume"
},
{
"type": "number",
"name": "Adj Close"
}
]
},
"data": [
{
"Date": "2000-03-01",
"Adj Close": 33.68,
"Open": 89.62,
"Low": 88.94,
"Volume": 106889800,
"High": 94.09,
"Close": 90.81
},
{
"Date": "2000-03-02",
"Adj Close": 34.63,
"Open": 91.81,
"Low": 91.12,
"Volume": 106932600,
"High": 95.37,
"Close": 93.37
}
]
})
To render a .table.json file as a tree, simply open it:
To install using pip:
pip install jupyterlab_table
# For JupyterLab
jupyter labextension install --py --sys-prefix jupyterlab_table
jupyter labextension enable --py --sys-prefix jupyterlab_table
# For Notebook
jupyter nbextension install --py --sys-prefix jupyterlab_table
jupyter nbextension enable --py --sys-prefix jupyterlab_table
Use the install.sh
script to build the Javascript, install the Python package, and install/enable the notebook and lab extensions:
bash install.sh --sys-prefix
Use the build.sh
script to rebuild the Javascript:
bash build.sh
Alternatively, see the README.md
in /labextension
and /nbextension
for extension-specific build instructions.
To install the Python package:
pip install -e .
To install the extension for JupyterLab:
jupyter labextension install --symlink --py --sys-prefix jupyterlab_table
jupyter labextension enable --py --sys-prefix jupyterlab_table
To install the extension for Jupyter Notebook:
jupyter nbextension install --symlink --py --sys-prefix jupyterlab_table
jupyter nbextension enable --py --sys-prefix jupyterlab_table