Skip to main content

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

swannotificationsservice-1.0.5.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swannotificationsservice-1.0.5-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file swannotificationsservice-1.0.5.tar.gz.

File metadata

  • Download URL: swannotificationsservice-1.0.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for swannotificationsservice-1.0.5.tar.gz
Algorithm Hash digest
SHA256 98fb442f688cfa5991b42708f9d40e36552bf48b6618beb975fdc6c6dd9d263d
MD5 726c8f6d8f1ea9cfd20c819884647567
BLAKE2b-256 ce7610de02492d1e0912a0a6bae6d5c685fff6e9d54c09d5b6930a1c6c03a63c

See more details on using hashes here.

Provenance

The following attestation bundles were made for swannotificationsservice-1.0.5.tar.gz:

Publisher: release.yml on swan-cern/jupyterhub-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swannotificationsservice-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for swannotificationsservice-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bcb1d20dccad4d12fff0ef4c55198f30b734d1c569019d20ed53f8eef269d334
MD5 089b964e302a25288a8d74ccecffd857
BLAKE2b-256 08094286d9e27c5c84973ab1d62b6431b12b67a97fbf952a2e0ee53f2b5814f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for swannotificationsservice-1.0.5-py3-none-any.whl:

Publisher: release.yml on swan-cern/jupyterhub-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page