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
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
Hashes for swannotificationsservice-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb5e2da9a070ef3bb0dedd68e0dc3ba918f85a74d2bf36792f8cc51e1f6a9465 |
|
MD5 | 4428ed64dbf69a2aa80432e941fa96aa |
|
BLAKE2b-256 | 676b7621609829967d8a2e048b39155b6d0c5598a60819c89daf2cc08a3b8711 |
Hashes for swannotificationsservice-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d96f06ff1946ae8c35766c1bf9aea25f399096edb85b1d050cd2621d14baeed |
|
MD5 | 8aee8a6eed87ae39d8060b54d3f9d252 |
|
BLAKE2b-256 | eb605653cd9e56c68c3a37e17fb82a4c97dedc03994df775d623173f93b88f1f |