Skip to content

gnestor/jupyterlab_json

 
 

Repository files navigation

jupyterlab_json

A JupyterLab and Jupyter Notebook extension for rendering JSON data

Prerequisites

  • JupyterLab ^0.17.0 and/or Notebook >=4.3.0

Usage

To render JSON-able dict or list in IPython:

output renderer

from IPython.display import JSON

JSON({
    "string": "string",
    "array": [1, 2, 3],
    "bool": True,
    "object": {
        "foo": "bar"
    }
})

To render a fully expanded tree:

JSON({
    "string": "string",
    "array": [1, 2, 3],
    "bool": True,
    "object": {
        "foo": "bar"
    }
}, expanded=True)

To render a JSON file in JupyterLab, simply open it:

file renderer

Install

To install using pip:

pip install jupyterlab_json
# For JupyterLab
jupyter labextension install --py --sys-prefix jupyterlab_json
jupyter labextension enable --py --sys-prefix jupyterlab_json
# For Notebook
jupyter nbextension install --py --sys-prefix jupyterlab_json
jupyter nbextension enable --py --sys-prefix jupyterlab_json

Development

Set up using install script

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

Set up manually

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_json
jupyter labextension enable --py --sys-prefix jupyterlab_json

To install the extension for Jupyter Notebook:

jupyter nbextension install --symlink --py --sys-prefix jupyterlab_json
jupyter nbextension enable --py --sys-prefix jupyterlab_json

About

A JupyterLab extension for rendering JSON data

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 79.0%
  • Shell 12.0%
  • Python 7.4%
  • CSS 1.6%