JupyterLab extension to support JSONiq magic within python cells. This extension is required to get the JSONiq LSP functionality.
Project description
JSONiq JupyterLab Extension
jsoniq-jupyterlab-extension is a JupyterLab extension that adds basic token highlighting for JSONiq code. Syntax highlighting with CodeMirror is enabled for jsoniq cells using the %%jsoniq magic and for .jq files.
Features
- Basic token highlighting - provides JSONiq token highlighting for
%%jsoniqmagic cells within Python notebooks. - Syntax highlighting for
.jqfiles - can be enabled for.jqfiles using the Jupyter language selector.
Installation
Install the extension from Python packaging. No npm or yarn installation is required for users.
To install, run:
pip install jsoniq-jupyterlab-extension
After installing the package, you may need to enable the extension in JupyterLab:
jupyter labextension enable jsoniq-jupyterlab-extension
Usage
Once the extension is installed and enabled, it automatically recognizes jsoniq magic cells and files for syntax highlighting.
Example
%%jsoniq
for $book in json-file("books.json")
where $book.price lt 20
return $book.title
This cell should become highlighted.
Development
To contribute to the development of jsoniq-jupyterlab, follow these steps:
-
Clone the repository:
git clone https://github.com/davidbuzatu-marian/jsoniq-jupyterlab.git cd jsoniq-jupyterlab
-
Install dependencies:
pnpm install # Install JavaScript dependencies pnpm run antlr4 # Generate parser from grammar uv python install # Setup Python environment using uv uv sync # Sync dependencies for Python environment
-
Build the extension:
uv run pnpm run build:prod
-
Link the extension for local development:
jupyter labextension link .
-
Launch JupyterLab:
jupyter lab
Building and testing the extension
To build the project for production, the following commands build the JavaScript files, build the Jupyter extension and install this result for local testing.
uv run pnpm run build:prod
Project Structure
src/: Contains the source code of the extension.dist/: Build artifacts for the extension.package.json: Contains the configuration and dependencies for the extension.tests/: Contains a set of tests relating to syntax highlighting.
Contributing
We welcome contributions to the jsoniq-jupyterlab-extension project! If you have any suggestions, bug reports, or pull requests, please feel free to submit them on the GitHub repository.
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsoniq_jupyterlab_extension-2.0.0a4.tar.gz.
File metadata
- Download URL: jsoniq_jupyterlab_extension-2.0.0a4.tar.gz
- Upload date:
- Size: 481.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1229099c085582a1932f9a387bdec5d8e92e4d8fd0848f5af96d8d072e4aa52
|
|
| MD5 |
add34cb5c492771b440a57cefd136a35
|
|
| BLAKE2b-256 |
444cef6804b0df91d236f194a0e7f10716f385470a3f9205aac56552b570120e
|
Provenance
The following attestation bundles were made for jsoniq_jupyterlab_extension-2.0.0a4.tar.gz:
Publisher:
publish.yml on RumbleDB/jsoniq-jupyterlab-extension
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsoniq_jupyterlab_extension-2.0.0a4.tar.gz -
Subject digest:
d1229099c085582a1932f9a387bdec5d8e92e4d8fd0848f5af96d8d072e4aa52 - Sigstore transparency entry: 1439631177
- Sigstore integration time:
-
Permalink:
RumbleDB/jsoniq-jupyterlab-extension@139502a30fb5560b0741c5c0fdcf1d57767dcac7 -
Branch / Tag:
refs/tags/v2.0.0-a4 - Owner: https://github.com/RumbleDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@139502a30fb5560b0741c5c0fdcf1d57767dcac7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jsoniq_jupyterlab_extension-2.0.0a4-py3-none-any.whl.
File metadata
- Download URL: jsoniq_jupyterlab_extension-2.0.0a4-py3-none-any.whl
- Upload date:
- Size: 234.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98401cda5b0feaba2e3ccf9aa8a43d0aaca5632c80152ec253312c9a44b6a07b
|
|
| MD5 |
240f0de8b51db14cca15f053b5fd65f7
|
|
| BLAKE2b-256 |
916c019562309a7899b8f9e9d356328462b10ddafb8f9163960ff2a89427f11e
|
Provenance
The following attestation bundles were made for jsoniq_jupyterlab_extension-2.0.0a4-py3-none-any.whl:
Publisher:
publish.yml on RumbleDB/jsoniq-jupyterlab-extension
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsoniq_jupyterlab_extension-2.0.0a4-py3-none-any.whl -
Subject digest:
98401cda5b0feaba2e3ccf9aa8a43d0aaca5632c80152ec253312c9a44b6a07b - Sigstore transparency entry: 1439631190
- Sigstore integration time:
-
Permalink:
RumbleDB/jsoniq-jupyterlab-extension@139502a30fb5560b0741c5c0fdcf1d57767dcac7 -
Branch / Tag:
refs/tags/v2.0.0-a4 - Owner: https://github.com/RumbleDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@139502a30fb5560b0741c5c0fdcf1d57767dcac7 -
Trigger Event:
release
-
Statement type: