Skip to main content

hegemony-notification-sdk

Public, dependency-light SDK for building Hegemony notification plugins — out-of-tree wheels that add notification destination types to the core platform at runtime.

A plugin depends only on this package (which depends only on pydantic) and exposes a register(registry) callable under the hegemony.notification_providers entry-point group:

# In your plugin's pyproject.toml
[project]
dependencies = ["hegemony-notification-sdk>=0.3,<0.4"]

[project.entry-points."hegemony.notification_providers"]
my_plugin = "my_plugin:register"

The SDK is released together with the plugins in this repository, under one version. From 0.3.3 on it is on PyPI (uv pip install hegemony-notification-sdk==X.Y.Z or pip install hegemony-notification-sdk==X.Y.Z); the release workflow uploads releases after 0.3.3 with trusted publishing and PEP 740 attestations (0.3.3 itself was uploaded by hand, without them). From the first release after 0.3.3, each GitHub release carries the same wheel and sdist, a SHA256SUMS file and the SLSA provenance bundle that gh attestation verify checks; earlier releases carry only the wheel and SHA256SUMS (plus the provenance bundle where one was made). While the major version is 0, an incompatible change to the contract is released as a new minor version, so depend on one minor line. The repository README walks through a complete transport and how to install a plugin into a Hegemony instance.

The simplest way to add a user-friendly channel is a preset over an existing transport. The plugin contributes a friendly config_schema and a pure build_config that rewrites the friendly fields into the base transport's config. Secret references pass through untouched — the host's base transport resolves them at send time, so the plugin never handles secrets or performs I/O.

# my_plugin/__init__.py
from hegemony_notification_sdk import NotificationPluginRegistry


def register(registry: NotificationPluginRegistry) -> None:
    registry.register_preset(
        destination_type="telegram",
        display_name="Telegram",
        description="Send via a Telegram bot.",
        base_transport="shoutrrr",
        build_config=lambda cfg: {
            "url_secret": f"telegram://{cfg['token']}@telegram?chats={cfg['chats']}"
        },
        config_schema={
            "type": "object",
            "required": ["token", "chats"],
            "properties": {
                "token": {"type": "string", "title": "Bot token (secret reference)"},
                "chats": {"type": "string", "title": "Chat IDs (comma-separated)"},
            },
        },
    )

Native transports

For channels that cannot be expressed as a preset, register a native destination type with its own send coroutine via register_destination_type(...).

ABI

SDK_ABI_VERSION is bumped only on incompatible changes to the registration contract. The platform exposes its value as registry.api_version so a plugin can self-gate if needed.

API reference

Import public contracts from hegemony_notification_sdk. This SDK exposes Python interfaces, not an HTTP endpoint.

Interface Inputs Result and calling convention
register_destination_type Keyword-only destination type, display name, description, send, and optional configuration schema Synchronous registration; returns None
register_preset The same identity fields, base transport, pure build_config, and optional configuration schema Synchronous registration; returns None
BuildConfigFn Configuration dictionary Synchronously returns the base transport's configuration dictionary; no I/O or secret resolution
SendFn NotificationSendContext Await the send coroutine; returns None on success and raises on failure

NotificationSendContext carries the configuration dictionary, message title, message body and injected NotificationServices. The host formats the title and body before dispatch. A transport uses these services:

Service Inputs Result and calling convention
resolve_secret_ref Reference or None; keyword-only source Async; await for a secret string or None
validate_secret_ref Reference; keyword-only field name and optional required flag Synchronous; normalized reference or None; raises on invalid input
render_message Template; keyword-only title, body and optional JSON-escaping flag Synchronous; rendered string
render_template Full-scope template string Async; await for the resolved string
contains_template String Synchronous; boolean

For example, use await ctx.services.resolve_secret_ref(ref, source="notification.my_plugin"). Keep resolved secrets out of logs and error messages. Presets pass protected references through unchanged.

From the repository root, render complete signatures and docstrings with:

uv sync --frozen --all-packages
uv run python -m pydoc hegemony_notification_sdk
uv run python -m pydoc hegemony_notification_sdk.registry
uv run python -m pydoc hegemony_notification_sdk.services

For local HTML browsing, run uv run python -m pydoc -b, open the SDK module, and follow its class/module links; stop the server when finished. With an installed SDK, omit uv run. Transport configuration and preset fields are documented in the core transports, Shoutrrr presets, and webhook presets references.

Metadata

Release files for hegemony-notification-sdk 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hegemony-notification-sdk 0.3.4
File Size Uploaded Provenance Actions
hegemony_notification_sdk-0.3.4.tar.gz 19.1 kB With provenance Details for hegemony_notification_sdk-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hegemony-notification-sdk 0.3.4
File Interpreter ABI Platform Actions
hegemony_notification_sdk-0.3.4-py3-none-any.whl Python 3 none any Details for hegemony_notification_sdk-0.3.4-py3-none-any.whl

Total release size: 38.9 kB

Release files / hegemony_notification_sdk-0.3.4.tar.gz

Download URL hegemony_notification_sdk-0.3.4.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a38b5e3b1c1da6a03964c7e1c2172bf0e399188cbcd672f07ba30fd86931dfb8
BLAKE2b-256 checksum
How to use checksums
6b3548d6c945ab6773830d3adb9eab54c3844ce2bf3ae10dbfa87c30ab0d86f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / hegemony_notification_sdk-0.3.4-py3-none-any.whl

Download URL hegemony_notification_sdk-0.3.4-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cef305767fc69405f07d6e89676abb772a85ea39a91c080e234af8a092704b7
BLAKE2b-256 checksum
How to use checksums
88f2cd6fe067895fe6a1f70ceee6e837623b266d20db469cb02f37ae03f6f336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for hegemony-notification-sdk 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hegemony_notification_sdk-0.3.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page