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.3.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.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swannotificationsservice-1.0.3.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

Hashes for swannotificationsservice-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5268407b6a2741f07d2e027e30f9bcc744601d81190c9aa8dc5d8af3a2055690
MD5 b62e56cbdb99bf1d893256783dab9709
BLAKE2b-256 5ebc09fe926a7c689b2b6ec79de20254956344d3f474aa4502250805101c1326

See more details on using hashes here.

Provenance

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

Publisher: swan-ci-ca.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for swannotificationsservice-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0994a8c4c58585fb3844e6ce866e517adfda0f93ea0011a404a01a4bbecb24e
MD5 40be1f13354c8477b19d23779223255b
BLAKE2b-256 a5a64c615cb7806f7e520f4c2a9bb92181703dfac76340027ac1ca39e7783581

See more details on using hashes here.

Provenance

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

Publisher: swan-ci-ca.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