7.3.0 • Published 6 days ago

@jupyterlab/services v7.3.0

Weekly downloads
45,543
License
BSD-3-Clause
Repository
github
Last release
6 days ago

JupyterLab Services

Javascript client for the Jupyter services REST APIs

API Docs

REST API Docs

Note: All functions and classes using the REST API allow a serverSettings parameter to configure requests.

Requests are made using the fetch API, which is available in modern browsers or in Node 18+.

Package Install

Prerequisites

npm install --save @jupyterlab/services
conda install jupyter-server # jupyter-server 2.0+ is recommended
# or `pip install jupyter-server`

Source Build

Prerequisites

See the building instructions for JupyterLab, which will build this module as part of the build process.

Rebuild

yarn run clean
yarn run build

Run Tests

Follow the source build instructions first.

yarn run test

Build Docs

Follow the source build instructions first.

yarn run docs

Navigate to docs/index.html.

Supported Runtimes

The runtime versions which should work are listed below. Earlier versions may also work, but come with no guarantees.

  • Node 10
  • Firefox 52+
  • Chrome 55+

Note: "requirejs" may need be included in a global context for Comm targets using the a target_module (in the classic Notebook). This can be as a <script> tag in the browser or by using the requirejs package in node (npm install requirejs and setting global.requirejs = require('requirejs');).

Starting the Jupyter Server

Follow the package install instructions first.

The library requires a running Jupyter Server, launched as:

jupyter server

or

jupyter lab

Bundling for the Browser

Follow the package install instructions first.

See examples/browser for an example of using Webpack to bundle the library.

Usage from Node.js

Follow the package install instructions first.

See examples/node for an example of using an ES5 node script.

Usage Examples

Note: This package is compiled to ES2018 JavaScript syntax from TypeScript. Here are some examples of using parts of this package. See the other examples subdirectories for more examples.

Overview

This package introduces a number of concepts, such as session context, etc. Here we give a brief overview of some of the top-level concepts in this package.

Clients

A client is a single entity connected to a kernel. Since kernel messages include the client id, it is easy for a client to filter kernel messages for just messages between it and the kernel. In JupyterLab, different activities (such as a console and a notebook) are usually considered separate clients when connected to the same kernel.

Kernel specs

A kernel spec is the data about an available kernel on the system. We can retrieve a current list of kernel specs from the server.

Kernels

A kernel represents a running process on the server that implements the Jupyter kernel messaging protocol.

Kernel model

A kernel model mirrors the server kernel models, and represents a single running kernel on the server. A kernel can be created, restarted, shut down, etc., through calls to the server. A kernel model's lifecycle mirrors the server kernel model's lifecycle, and it will be disposed when the server kernel is shut down.

Kernel connection

A kernel connection represents a single client connecting to a kernel over a websocket. Typically only one kernel connection handles comms for any given kernel. The kernel connection is disposed when the client no longer has a need for the connection. Disposing a kernel connection does not cause the kernel to shut down. However, if a kernel is shut down, (eventually) all of its kernel connections should be disposed if they were initiated from a kernel manager. If the kernel connections were instantiated outside of a manager, you are responsible for cleaning them up.

A kernel connection has a number of signals, such as kernel status, kernel connection status, etc.

Kernel manager

A kernel manager is an object that maintains a list of kernel models by regular polling. The kernel manager can instantiate a kernel connection and will manage its lifecycle (e.g., when the kernel is shut down, the connections will be disposed). The manager provides some minimal bookkeeping around kernels and their connections. Generally, it is easiest to interact with kernels on a server through a manager.

Sessions

A session is a mapping on the server from an identifying string (the session's path) to a kernel. A session has a few other pieces of information to allow for easy categorization and searching of sessions.

The primary usecase of a session is to enable persisting a connection to a kernel. For example, a notebook viewer may start a session with session path of the notebook's file path. When a browser is refreshed, the notebook viewer can connect to the same kernel by asking the server for the session corresponding with the notebook file path.

Session model

A session model mirrors a server session. The session models can be refreshed from the server, created, changed (including creating a new session kernel), and shut down (which implies that the kernel will be shut down). A session model's lifecycle mirrors the server session's lifecycle, and it will be disposed when the server session is shut down.

Session connection

A session connection represents a single client connected to a session's kernel. A session's kernel connection can change and may be null to signify no current kernel connection. A session connection owns the kernel connection, meaning the kernel connection is created and disposed by the session connection as needed. The session connection proxies signals from the kernel connection for convenience (e.g., you can listen to the session's status signal to get status changes for whatever the current kernel is, without having to disconnect and reconnect your signal handlers every time the session kernel changes). The session connection can be disposed when the client no longer is connected to that session's kernel, and disposal will not cause the session model to be deleted.

Session manager

A session manager is an object that maintains a list of session models by regular polling. The session manager can instantiate a session connection and will manage its lifecycle (e.g., when the session is shut down, the connections will be disposed). The manager provides some minimal bookkeeping around sessions and their connections. Generally, it is easiest to interact with sessions on a server through a manager.

Session Context

A session context is an object which has the same lifecycle as the client. The session context owns a session connection (which may be null if the client is not currently associated with a session). The session context proxies the current session connection's signals for convenience. The session context primarily serves as a stable object for a client to keep track of the current session connection. The session context also contains some convenience functionality, such as preferences for whether a kernel should be started and a user-friendly kernel name and status.

Here is a diagram that provides an overview of the different components:

architecture-diagram

The diagram can be edited on diagrams.net by importing the source.

@educational-technology-collective/etc-jupyterlab-aws-api-s3-handler@educational-technology-collective/etc_jupyterlab_aws_api_s3_handler@educational-technology-collective/etc_jupyterlab_notebook_state@educational-technology-collective/etc_jupyterlab_telemetry_extension@educational-technology-collective/etc_jupyterlab_telemetry_validate_button@educational-technology-collective/jupyterlab-nbgrader-validate@blackwalnutlab/jupyterlab_micropython_ext@blackwalnutlab/temp_tensorboard@odahu/jupyter-legion-test@tokarevtest/jupz@platiagro/url-functions-extensionjupyterlab-bind-ext-2@kaggle/jupyterlab@amranprogramming/applicationverdant-log@educational-technology-collective/jupyterlab-telemetrynotebook-uuid@adpatter/jupyterlab-telemetry@educational-technology-collective/etc-jupyterlab-service-extension-examplejlmc@maap-jupyterlab/dps-jupyter-server-extension@ccasseau/moon@infinitebrahmanuniverse/nolb-_jupjupyter-voice-commentsdfc-elyra@everything-registry/sub-chunk-504waka-jlabsagemaker-extsagemaker_digit_extensionsai-managertelemetry-producertelemetry-routerstarboard-jupyterserialhubthebe-coreverdant-historyvp4jl@hej131/jupyterlab-apputils@datalayer/jupyter-iamlinsteinnotebookgreenflowlabjs2fskjlab_aiidatreejlab_homepageibis-vega-transformipyurlj1-nbinteract-corekernel_killerhintbothow-to-publish-to-npm-tlyhow-to-publish-to-npm-tly2imjoy-jupyter-extensionihaskell_jupyterlabgquantlabgpt_jupyterlabgrader-labextensionjupyterlab-link-sharejupyterlab-liveupdatejupyterlab-mavenworksjupyterlab-media-capturejupyterlab-mlsnippetsjupyterlab-monitorjupyterlab-printviewjupyterlab-proxy-guijupyterlab-publishfnjupyterlab-python-bytecodejupyterlab-quickopenjupyterlab-recentsjupyterlab-remote-contentsjupyterlab-s3-browserjupyterlab-search-replacejupyterlab-edit-magicjupyterlab-gitlabjupyterlab-hdfjupyterlab-ielixirjupyterlab-ihaskelljupyterlab-judgejupyterlab-kernel-messagejupyterlab-pioneerjupyterlab-pioneer-custom-event-demojupyterlab-notifierjupyterlab-openbayes-bindingsjupyterlab-openbayes-dataset-browserjupyterlab-infinstorjupyterlab-interactive-dashboard-editorjupyterlab-favoritesjupyterlab-filesystem-accessjupyterlab-imgclipjupyterlab_remote_urljupyterlab_rootjsjupyterlab_schedulerjupyterlab_shutdownjupyterlab_sparkmonitorjupyterlab_sparkmonitor-sjupyterlab-ws-chatjupyterlab-zipjupyterlab_3dmoljupyterlab_autoversionjupyterlab_bokehjupyterlab_cells_datacube
7.3.0

6 days ago

7.3.0-rc.1

13 days ago

7.3.0-beta.3

29 days ago

7.3.0-beta.2

1 month ago

7.3.0-rc.0

22 days ago

7.3.0-alpha.2

4 months ago

7.3.0-alpha.1

4 months ago

7.3.0-alpha.0

6 months ago

7.3.0-beta.1

2 months ago

7.3.0-beta.0

3 months ago

6.6.8

2 months ago

7.2.5

2 months ago

7.2.4

4 months ago

7.2.3

4 months ago

7.2.2

5 months ago

7.2.1

6 months ago

7.2.0

6 months ago

7.1.7

6 months ago

7.1.8

6 months ago

7.2.0-rc.0

6 months ago

7.2.0-beta.3

7 months ago

7.2.0-beta.2

7 months ago

7.2.0-beta.1

7 months ago

7.1.6

7 months ago

7.2.0-beta.0

7 months ago

7.1.5

8 months ago

7.2.0-alpha.1

8 months ago

7.2.0-alpha.2

8 months ago

7.1.4

8 months ago

7.1.3

8 months ago

7.2.0-alpha.0

8 months ago

7.0.13

8 months ago

7.1.2

9 months ago

7.1.1

9 months ago

7.1.0

9 months ago

7.1.0-rc.1

9 months ago

7.0.12

9 months ago

7.1.0-rc.0

9 months ago

6.6.7

10 months ago

7.0.11

10 months ago

7.1.0-beta.2

10 months ago

7.1.0-beta.1

10 months ago

7.0.10

10 months ago

7.1.0-beta.0

11 months ago

6.6.6

1 year ago

7.0.8

1 year ago

7.0.7

1 year ago

7.0.6

1 year ago

7.0.5

1 year ago

7.0.9

12 months ago

7.0.4

1 year ago

7.0.3

1 year ago

7.1.0-alpha.1

1 year ago

7.1.0-alpha.2

1 year ago

7.1.0-alpha.3

12 months ago

7.1.0-alpha.4

11 months ago

6.6.5

1 year ago

6.6.4

1 year ago

7.0.0-rc.1

2 years ago

7.0.0

1 year ago

7.0.2

1 year ago

7.0.1

1 year ago

6.6.1

2 years ago

6.6.0

2 years ago

6.6.3

2 years ago

6.6.2

2 years ago

7.0.0-rc.0

2 years ago

7.0.0-alpha.22

2 years ago

7.0.0-alpha.20

2 years ago

7.0.0-alpha.21

2 years ago

7.0.0-alpha.19

2 years ago

7.0.0-alpha.18

2 years ago

7.0.0-beta.2

2 years ago

7.0.0-beta.0

2 years ago

7.0.0-beta.1

2 years ago

6.6.0-alpha.3

2 years ago

6.6.0-alpha.4

2 years ago

6.6.0-alpha.5

2 years ago

6.6.0-rc.0

2 years ago

6.6.0-rc.1

2 years ago

6.6.0-beta.0

2 years ago

7.0.0-alpha.16

2 years ago

7.0.0-alpha.17

2 years ago

6.5.2

2 years ago

6.5.1

2 years ago

6.5.3

2 years ago

6.5.0

2 years ago

6.6.0-alpha.1

2 years ago

6.6.0-alpha.2

2 years ago

6.6.0-alpha.0

2 years ago

6.5.0-alpha.0

2 years ago

6.5.0-beta.0

2 years ago

6.5.0-rc.0

2 years ago

7.0.0-alpha.15

2 years ago

7.0.0-alpha.14

2 years ago

6.4.8

2 years ago

7.0.0-alpha.13

2 years ago

6.4.7

2 years ago

6.4.6

2 years ago

7.0.0-alpha.12

2 years ago

6.4.5

2 years ago

6.4.4

2 years ago

7.0.0-alpha.11

2 years ago

7.0.0-alpha.10

2 years ago

6.4.3

2 years ago

6.4.2

2 years ago

6.4.1

2 years ago

6.4.0

3 years ago

6.4.0-rc.0

3 years ago

7.0.0-alpha.9

3 years ago

7.0.0-alpha.8

3 years ago

6.4.0-alpha.0

3 years ago

6.3.4

3 years ago

6.3.3

3 years ago

6.4.0-beta.0

3 years ago

7.0.0-alpha.7

3 years ago

7.0.0-alpha.6

3 years ago

6.3.0

3 years ago

6.3.2

3 years ago

6.3.1

3 years ago

6.3.0-rc.0

3 years ago

6.1.18

3 years ago

6.3.0-beta.0

3 years ago

6.3.0-alpha.18

3 years ago

6.3.0-alpha.17

3 years ago

6.3.0-alpha.16

3 years ago

7.0.0-alpha.3

3 years ago

7.0.0-alpha.5

3 years ago

7.0.0-alpha.4

3 years ago

6.2.7

3 years ago

6.2.6

3 years ago

6.2.9

3 years ago

6.2.8

3 years ago

6.3.0-alpha.15

3 years ago

7.0.0-alpha.1

3 years ago

7.0.0-alpha.2

3 years ago

6.2.5

3 years ago

6.2.4

3 years ago

6.2.3

3 years ago

6.2.2

3 years ago

6.1.17

3 years ago

6.3.0-alpha.14

3 years ago

6.3.0-alpha.13

3 years ago

6.3.0-alpha.12

3 years ago

6.2.1

3 years ago

6.2.0

3 years ago

6.2.0-rc.0

3 years ago

6.1.16

3 years ago

6.1.15

3 years ago

6.2.0-beta.0

3 years ago

6.1.13

3 years ago

6.3.0-alpha.11

3 years ago

6.2.0-alpha.1

3 years ago

6.1.12

3 years ago

6.2.0-alpha.0

3 years ago

6.1.11

3 years ago

6.3.0-alpha.10

3 years ago

6.3.0-alpha.9

3 years ago

6.1.10

3 years ago

6.3.0-alpha.8

3 years ago

6.1.9

3 years ago

6.3.0-alpha.7

3 years ago

6.3.0-alpha.6

3 years ago

6.1.8

3 years ago

6.1.7

3 years ago

6.3.0-alpha.5

3 years ago

6.1.6

3 years ago

6.3.0-alpha.4

3 years ago

6.1.5

3 years ago

6.3.0-alpha.2

3 years ago

6.3.0-alpha.3

3 years ago

6.1.4

3 years ago

6.3.0-alpha.1

3 years ago

6.0.10

3 years ago

5.3.1

3 years ago

6.1.2

3 years ago

6.1.1

3 years ago

6.1.3

3 years ago

6.1.0

3 years ago

6.3.0-alpha.0

3 years ago

6.1.0-rc.2

3 years ago

6.1.0-rc.0

3 years ago

6.1.0-rc.1

3 years ago

6.1.0-beta.2

3 years ago

6.1.0-beta.1

3 years ago

6.1.0-beta.0

3 years ago

6.1.0-alpha.13

3 years ago

6.1.0-alpha.11

3 years ago

6.1.0-alpha.12

3 years ago

6.0.9

3 years ago

6.0.8

3 years ago

6.1.0-alpha.10

3 years ago

6.1.0-alpha.9

3 years ago

6.1.0-alpha.8

3 years ago

6.1.0-alpha.7

3 years ago

6.1.0-alpha.6

3 years ago

6.1.0-alpha.5

4 years ago

6.0.7

4 years ago

6.0.6

4 years ago

6.1.0-alpha.4

4 years ago

5.3.0

4 years ago

6.0.5

4 years ago

6.1.0-alpha.3

4 years ago

6.0.4

4 years ago

6.1.0-alpha.2

4 years ago

6.1.0-alpha.1

4 years ago

6.1.0-alpha.0

4 years ago

6.0.3

4 years ago

5.3.0-rc.0

4 years ago

6.0.1

4 years ago

6.0.2

4 years ago

6.0.0

4 years ago

6.0.0-rc.15

4 years ago

6.0.0-rc.14

4 years ago

6.0.0-rc.12

4 years ago

6.0.0-rc.13

4 years ago

5.3.0-alpha.2

4 years ago

6.0.0-rc.11

4 years ago

6.0.0-rc.10

4 years ago

6.0.0-rc.9

4 years ago

6.0.0-rc.8

4 years ago

6.0.0-rc.7

4 years ago

6.0.0-rc.6

4 years ago

5.2.5

4 years ago

5.3.0-alpha.1

4 years ago

6.0.0-rc.5

4 years ago

5.3.0-alpha.0

4 years ago

6.0.0-rc.4

4 years ago

6.0.0-rc.3

4 years ago

6.0.0-rc.2

4 years ago

6.0.0-rc.1

4 years ago

6.0.0-rc.0

4 years ago

6.0.0-beta.8

4 years ago

6.0.0-beta.7

4 years ago

6.0.0-beta.6

4 years ago

6.0.0-beta.5

4 years ago

4.2.3

4 years ago

5.2.4

4 years ago

6.0.0-beta.4

4 years ago

6.0.0-beta.3

4 years ago

6.0.0-beta.2

4 years ago

6.0.0-beta.1

4 years ago

6.0.0-beta.0

4 years ago

5.2.3

4 years ago

6.0.0-alpha.12

4 years ago

6.0.0-alpha.13

4 years ago

6.0.0-alpha.14

4 years ago

6.0.0-alpha.11

4 years ago

5.2.2

4 years ago

6.0.0-alpha.10

4 years ago

6.0.0-alpha.9

4 years ago

6.0.0-alpha.8

4 years ago

6.0.0-alpha.7

4 years ago

5.2.1

4 years ago

6.0.0-alpha.6

4 years ago

6.0.0-alpha.5

4 years ago

5.2.0

4 years ago

6.0.0-alpha.3

4 years ago

6.0.0-alpha.4

4 years ago

6.0.0-alpha.1

4 years ago

6.0.0-alpha.2

4 years ago

5.2.0-rc.1

4 years ago

5.2.0-rc.0

4 years ago

5.2.0-alpha.2

4 years ago

6.0.0-alpha.0

4 years ago

5.2.0-alpha.0

4 years ago

4.2.2

5 years ago

4.2.1

5 years ago

5.1.0

5 years ago

5.0.3

5 years ago

5.1.0-rc.0

5 years ago

5.1.0-beta.0

5 years ago

5.1.0-a.0

5 years ago

5.0.2

5 years ago

5.0.1

5 years ago

5.0.0

5 years ago

5.0.0-rc.2

5 years ago

5.0.0-rc.1

5 years ago

5.0.0-rc.0

5 years ago

5.0.0-beta.3

5 years ago

5.0.0-beta.2

5 years ago

5.0.0-beta.1

5 years ago

5.0.0-beta.0

5 years ago

5.0.0-alpha.4

5 years ago

5.0.0-alpha.3

5 years ago

5.0.0-alpha.2

5 years ago

4.2.0

5 years ago

4.2.0-rc.0

5 years ago

4.2.0-alpha.3

5 years ago

4.2.0-alpha.2

5 years ago

4.2.0-alpha.1

5 years ago

5.0.0-alpha.1

5 years ago

5.0.0-alpha.0

5 years ago

4.1.1

5 years ago

4.2.0-alpha.0

5 years ago

4.1.0

5 years ago

4.1.0-rc.0

5 years ago

4.0.5

5 years ago

4.0.4

5 years ago

4.1.0-alpha.2

5 years ago

4.0.3

5 years ago

4.1.0-alpha.1

5 years ago

4.1.0-alpha.0

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

4.0.0-rc.1

5 years ago

4.0.0-rc.0

5 years ago

4.0.0-alpha.13

5 years ago

4.0.0-alpha.12

5 years ago

4.0.0-alpha.11

5 years ago

4.0.0-alpha.10

5 years ago

4.0.0-alpha.9

5 years ago

4.0.0-alpha.8

5 years ago

4.0.0-alpha.7

5 years ago

4.0.0-alpha.6

6 years ago

4.0.0-alpha.5

6 years ago

4.0.0-alpha.4

6 years ago

4.0.0-alpha.3

6 years ago

4.0.0-alpha.2

6 years ago

4.0.0-alpha.1

6 years ago

4.0.0-alpha.0

6 years ago

3.2.1

6 years ago

3.2.1-alpha.0

6 years ago

3.1.4

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.0

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0-1

6 years ago

3.0.0-0

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.52.0

7 years ago

0.51.0

7 years ago

0.50.2

7 years ago

0.50.1

7 years ago

0.50.0

7 years ago

0.49.0

7 years ago

0.40.4

7 years ago

0.48.0

7 years ago

0.47.1

7 years ago

0.47.0

7 years ago

0.46.0

7 years ago

0.45.0

7 years ago

0.44.0

7 years ago

0.43.0

7 years ago

0.42.1

8 years ago

0.42.0

8 years ago

0.41.0

8 years ago

0.40.3

8 years ago

0.40.2

8 years ago

0.40.1

8 years ago

0.40.0

8 years ago

0.39.1

8 years ago

0.39.0

8 years ago

0.38.0

8 years ago

0.37.0

8 years ago

0.36.1

8 years ago

0.36.0

8 years ago

0.35.1

8 years ago

0.35.0

8 years ago

0.34.3

8 years ago

0.34.2

8 years ago

0.34.1

8 years ago

0.34.0

8 years ago

0.33.1

8 years ago

0.33.0

8 years ago

0.32.0

8 years ago

0.31.0

8 years ago

0.30.2

8 years ago

0.30.1

8 years ago

0.30.0

8 years ago

0.29.0

8 years ago

0.28.0

8 years ago

0.27.0

8 years ago

0.26.0

8 years ago

0.25.0

8 years ago

0.24.0

8 years ago

0.23.0

8 years ago

0.22.0

8 years ago