Novu Client (Python)
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:
- 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
- Retrieve your API key from the platform directly in the settings section: https://web.novu.co/settings
- 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
Metadata
Release files for novu-python 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| novu_python-1.1.0.tar.gz | 25.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| novu_python-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.3 kB
Release files / novu_python-1.1.0.tar.gz
| Download URL | novu_python-1.1.0.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b72c1aafd550b60e784f2f6873f9f29066031e285e474388a5a86761c4a5db86
|
|
BLAKE2b-256 checksum How to use checksums |
c9e537a50e52b46377b58692d9c827c09ba758497c305c1be923de4cf15930e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.16 Linux/5.15.0-1034-azure
|
Release files / novu_python-1.1.0-py3-none-any.whl
| Download URL | novu_python-1.1.0-py3-none-any.whl |
|---|---|
| Size | 41.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
449e5196e01e6513b3a383ef466eaaa73e8980e1cde8d3743c7403ca28c0b3f9
|
|
BLAKE2b-256 checksum How to use checksums |
acf397f1de328e86b0b89de0e18716f77bf8f5c99d85c9a2d0bbeda7981ed3fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.16 Linux/5.15.0-1034-azure
|