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-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bb77a1f23054b3b5536f34076f1db33713fa1ff2dc714d7a8ce7eda85a2b43a |
|
MD5 | 1c3854e2d480802985f9d0bef160a768 |
|
BLAKE2b-256 | 2ed01b39fccf3e02eb2bc9be5781239feac9639f9b6b801f78d50fa9596be3a4 |
Hashes for swannotificationsservice-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8c68c386d24304aeebca717d50917e9e80562026681efa04b5e3ee94733d8c |
|
MD5 | 7ee571de10ca3ff76744aa807be94601 |
|
BLAKE2b-256 | 16a61747f22428d80bcbd7e18f97a8ea8930077b7a97b0fb33772e707bbd32f3 |