Skip to content

Python SDK for Novu - The open-source notification infrastructure for engineers. 🚀

License

Notifications You must be signed in to change notification settings

nefino/novu-python

 
 

Repository files navigation

Python Novu SDK

PyPI Tests Status codecov pre-commit Code style: black Checked with mypy PyPI - Python Version PyPI - License semantic-release: angular


The Python Novu SDK and package provides a fluent and expressive interface for interacting with Novu's API and managing notifications.

Install

To install this package

# Via pip
pip install novu

# Via poetry
poetry add novu

Quick start

This package is a wrapper of all the resources offered by Novu, we will just start by triggering an event on Novu.

To do this, you will need to:

  1. Create your first notification template and keep in mind the identifier to trigger the template: https://docs.novu.co/overview/quick-start#create-a-notification-template
  2. Retrieve your API key from the Novu dashboard directly in the settings section: https://web.novu.co/settings
  3. Write code to trigger your first event:
from novu.api import EventApi

event_api = EventApi("https://api.novu.co/api/", "<NOVU_API_TOKEN>")
event_api.trigger(
    name="<YOUR_TEMPLATE_NAME>",
    recipients="<YOUR_SUBSCRIBER_ID>",
    payload={},  # Your Novu payload goes here
)

This will trigger a notification to the subscribers.

Development

# install deps
poetry install

# pre-commit
poetry run pre-commit install --install-hook
poetry run pre-commit install --install-hooks --hook-type commit-msg

About

Python SDK for Novu - The open-source notification infrastructure for engineers. 🚀

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 99.4%
  • Other 0.6%