JupyterHub service to expose notifications for Jupyter
Project description
SwanNotificationsService
JupyterHub service that exposes an API with notifications for the logged in user. The notifications are specified in a json file. If a "maintenance file" exists, a notification will be given that the service is under maintenance.
This extension works in conjunction with SwanNotifications.
Requirements
This module requires and installs JupyterHub.
Installation
Install the package:
pip install swannotificationsservice
Update the container image
This folder contains a Dockerfile that can be used to create an image for the pod that runs the notifications service. Once you release to PyPI you need to create a new image, e.g.
docker build -t gitlab-registry.cern.ch/swan/docker-images/jupyterhub/notifications:v0.1.0 && docker push gitlab-registry.cern.ch/swan/docker-images/jupyterhub/notifications:v0.1.0
Usage
Call the binary and specify configuration parameters:
swannotificationsservice --notifications_file /srv/jupyterhub/notifications.json
Configuration parameters:
- port (default: 8888)
- notifications_file (default: /srv/jupyterhub/notifications.json)
- maintenance_file (default: /etc/nologin)
- prefix (default: /)
Notifications file example:
[
{
"user": "*",
"id": "notif1",
"level": "info",
"dismissible": 0,
"message": "This is a notification"
}
]
Explanation:
- user: username or '*' for all users;
- id: unique identifier;
- level: type of the notification (notice, info, success, or error)
- dismissible: wether the user will be able to permanently hide the notification (0 or 1)
- message: the text/html message
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
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 swannotificationsservice-1.0.4.tar.gz.
File metadata
- Download URL: swannotificationsservice-1.0.4.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
926c9d41c6dbdec40d3d0a6e3a8344c42c8f92acd9ac1185f632a448b5cb6dc7
|
|
| MD5 |
49fabf41b35ed4dbd256dc4f67c220e3
|
|
| BLAKE2b-256 |
1fe485a2a6ddb6e6e3522ccb36309fc58c777606641d36b1f5426085902a17b0
|
Provenance
The following attestation bundles were made for swannotificationsservice-1.0.4.tar.gz:
Publisher:
swan-ci-ca.yml on swan-cern/jupyterhub-extensions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swannotificationsservice-1.0.4.tar.gz -
Subject digest:
926c9d41c6dbdec40d3d0a6e3a8344c42c8f92acd9ac1185f632a448b5cb6dc7 - Sigstore transparency entry: 1025997954
- Sigstore integration time:
-
Permalink:
swan-cern/jupyterhub-extensions@2d46bb05ba3b324705108df5d68d5b43fc48ed45 -
Branch / Tag:
refs/tags/SwanNotificationsService/v1.0.4 - Owner: https://github.com/swan-cern
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
swan-ci-ca.yml@2d46bb05ba3b324705108df5d68d5b43fc48ed45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file swannotificationsservice-1.0.4-py3-none-any.whl.
File metadata
- Download URL: swannotificationsservice-1.0.4-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79044f4f68f82675741a20d9961ffefcd2df85e19ddd58ad68af1f8b1f526392
|
|
| MD5 |
41306c38e63624c989180537505b96aa
|
|
| BLAKE2b-256 |
566b46c13f9b0e702527e7029b7aa46bb56e8afab60dc1d5d6fab9fbb4d717b2
|
Provenance
The following attestation bundles were made for swannotificationsservice-1.0.4-py3-none-any.whl:
Publisher:
swan-ci-ca.yml on swan-cern/jupyterhub-extensions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swannotificationsservice-1.0.4-py3-none-any.whl -
Subject digest:
79044f4f68f82675741a20d9961ffefcd2df85e19ddd58ad68af1f8b1f526392 - Sigstore transparency entry: 1025998022
- Sigstore integration time:
-
Permalink:
swan-cern/jupyterhub-extensions@2d46bb05ba3b324705108df5d68d5b43fc48ed45 -
Branch / Tag:
refs/tags/SwanNotificationsService/v1.0.4 - Owner: https://github.com/swan-cern
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
swan-ci-ca.yml@2d46bb05ba3b324705108df5d68d5b43fc48ed45 -
Trigger Event:
push
-
Statement type: