Skip to main content

A simple Jsonnet kernel for Jupyter

Project description

Jupyter-Jsonnet

This package provides a Jupyter Kernel to support the Jsonnet language. It is based on the official Jsonnet Python bindings.

After installing it, you need to register it to Jupyter with the command:

python3 -m jupyter_jsonnet.post_install

This kernel extends jsonnet syntax slightly to permit

  • Cells containing only statements (These produce no result, but are checked for errrors).
  • Definitions (statements) from previous cells to carry over, even if the cell containing the definition produced a result.
  • Using //jupyter: string as the first line of a cell causes the output to be the raw string instead of the json-escaped version, similarly to --string at the CLI. For use with e.g. std.manifestTomlEx()

The parsing to separate statements from expressions is very simple, and can easily be fooled by semicolons that do not terminate statements, like in comments or strings.

Building from Source

Ensure PyPA build is installed:

pip3 install build
python3 -m build

I don't currently have a satisfactory way of doing develop/editable installs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter-jsonnet-0.4.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

jupyter_jsonnet-0.4-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page