Skip to main content

This project aims to provide a wrapper for the Novu API.

Project description

Novu Client (Python)

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


This project aims to provide a python wrapper for the Novu API.

:warning: This deposit is not officially maintained by novuhq. The Novu software development team is currently (March 2023) thinking of using the ferns solution to create an SDK for all languages for easier maintenance. For more details on the subject or to follow the progress on the official SDK support, you can check the issue https://github.com/novuhq/novu/issues/2835.

Install

To install this package

# Via pip
pip install novu-python

# Via poetry
poetry add novu-python

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. Follow Novu's procedure on how to set up your first 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 platform directly in the settings section: https://web.novu.co/settings
  3. Play the following script:
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
)

If all is ok, this should have triggered a notification in Novu.

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

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

novu_python-1.1.0.tar.gz (25.3 kB view hashes)

Uploaded Source

Built Distribution

novu_python-1.1.0-py3-none-any.whl (41.0 kB view hashes)

Uploaded Python 3

Supported by

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