Python SDK

Connect a Python application to Novu

Novu's Python SDK provides simple, yet comprehensive notification management, and delivery capabilities through multiple channels that you can implement using code that integrates seamlessly with your Python application.

Explore the source code on GitHub

Installation

PIP is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

pip install novu-py

Usage

import novu_py
from novu_py import Novu
import os
 
with Novu(
secret_key=os.getenv("NOVU_SECRET_KEY", ""),
) as novu:
 
    res = novu.trigger(trigger_event_request_dto=novu_py.TriggerEventRequestDto(
        workflow_id="workflow_identifier",
        to={
            "subscriber_id": "subscriber_unique_identifier",
            "first_name": "Albert",
            "last_name": "Einstein",
            "email": "albert@einstein.com",
        },
        payload={
            "comment_id": "string",
            "post": {
                "text": "string",
            },
        },
        overrides={
          "email": {
            "bcc": "no-reply@novu.co"
          }
        },
    ))
 
    # Handle response
    print(res)

On this page