Main entrypoint for jyg.
Project description
jyg
run Jupyter browser client commands from a CLI, REST API, or other browser windows
See the full documentation on ReadTheDocs.
Installation
Note: after installing the browser and server extension, you'll need to restart your server and/or refresh your Jupyter client browser session.
Prerequisites
- python >=3.8
- jupyterlab >=3
pip
TBD
pip install jyg jupyterlab
mamba
TBD
mamba install -c conda-forge jyg jupyterlab python >=3.8... or use
conda
if you must.
Development Install
See the contributing guide for a development install.
Quick Start
Before running any of the above, please ensure you have installed the
jyg
extension for your Jupyter client and server.
Browser
- In Advanced Settings: Command Boards
- Create a new Board with a
template
like<button data-command-id="help:licenses">Show Licenses</button>
- or more complicated
<button data-command-id="apputils:change-theme" data-command-args='{"theme": "JupyterLab Dark"}' > Set theme </button>
- Create a new Board with a
- Click the Launcher Item for the board
- Or use the Command Palette
- Click the elements in the board
CLI
List commands
jyg list --json
jyg ls
jyg l
Run commands
the following are all equivalent
jyg run filebrowser:open '{"path": "Untitled.ipynb"}'
jyg run filebrowser:open --path=Untitled.ipynb
jyg r filebrowser:open --path Untitled.ipynb
REST API
List commands
GET http://localhost:8888/jyg/commands
{
"apps": [
{
"url": "http://localhost:8888"
}
]
}
Run a command
POST http://localhost:8888/jyg/command/docmanager:open
{
"path": "Untitled.ipynb"
}
Troubleshooting
If various pieces do not appear to be working, try some of the steps below.
Verify the installation
jupyter server extension list
You should see some output that includes:
jyg enabled - Validating jyg... jyg x.x.x OK
If not present, you might be able to re-enable it with:
jupyter server extension enable --sys-prefix --py jyg
jupyter labextension list
You should see something like:
@deathbeds/jyg vx.x.x enabled OK
The server is running
Make sure the server is running.
jupyter server list
The application is running
To run or list commands, the browser must be running the client. Also look at the Browser Console (usually shown with f12) for any explicit errors or warnings.
Frequently Asked Questions
Does jyg
work with Jupyter notebook <7
?
No. And it won't.
Does jyg
work with Jupyter notebook >=7
?
Not yet.
Does jyg
work with another backend than jupyter_server
?
No. However, the API is relatively straightforward.
Can $MY_APPLICATION
use jyg
to drive Jupyter clients?
Probably not. jyg
only provides a way to operate its host application in co-deployed
<iframe>
(Command Boards).
The API is available, however, to create custom extensions which would allow a web page
that already had access to the Jupyter application to register use postMessage
.
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.