https://github.com/remarkablemark/novu-framework
🔔 Novu Framework for Python (WIP)
https://github.com/remarkablemark/novu-framework
framework novu package python python3
Last synced: 8 days ago
JSON representation
🔔 Novu Framework for Python (WIP)
- Host: GitHub
- URL: https://github.com/remarkablemark/novu-framework
- Owner: remarkablemark
- License: mit
- Created: 2026-01-21T02:03:43.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-04-03T16:08:54.000Z (9 days ago)
- Last Synced: 2026-04-03T19:34:39.967Z (9 days ago)
- Topics: framework, novu, package, python, python3
- Language: Python
- Homepage: http://remarkablemark.org/novu-framework/
- Size: 316 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# novu-framework
[](https://pypi.org/project/novu-framework/)
[](https://codecov.io/gh/remarkablemark/novu-framework)
[](https://github.com/remarkablemark/novu-framework/actions/workflows/lint.yml)
🔔 Novu Framework allows you to write notification workflows in your Python codebase. Inspired by [@novu/framework](https://www.npmjs.com/package/@novu/framework).
## Prerequisites
- [Python 3.10+](https://www.python.org/)
## Install
Install the package:
```sh
pip install novu-framework
```
## Quick Start
### Define Workflow
```python
from novu_framework import workflow
from pydantic import BaseModel
class CommentPayload(BaseModel):
comment: str
post_id: str
class EmailControls(BaseModel):
subject: str = "New Comment"
include_footer: bool = True
@workflow("comment-notification")
def comment_workflow(payload: CommentPayload, step):
# In-app notification step (using dict)
step.in_app("new-comment", {
"body": f"New comment: {payload.comment}",
"action_url": f"/posts/{payload.post_id}"
})
# Email notification step (using lambda)
step.email("comment-email", lambda controls: {
"subject": controls.subject,
"body": f"You received a new comment: {payload.comment}",
"footer": "Thanks for using our app!" if controls.include_footer else ""
}, controlSchema=EmailControls)
```
### Trigger Workflow
```python
comment_workflow.trigger(
to="subscriber_id_123",
payload={
"comment": "This is a great post!",
"post_id": "post_id_456"
}
)
```
### Serve with FastAPI
```python
from fastapi import FastAPI
from novu_framework.fastapi import serve
app = FastAPI()
serve(app, route="/api/novu", workflows=[comment_workflow])
```
### Serve with Flask
```python
from flask import Flask
from novu_framework.flask import serve
app = Flask(__name__)
serve(app, route="/api/novu", workflows=[comment_workflow])
```
## Features
- **Code-First Workflows**: Define workflows using Python functions and decorators.
- **Type Safety**: Built-in support for Pydantic models for payload validation.
- **Multi-Channel Support**: Support for In-App, Email, SMS, and Push notifications.
- **FastAPI Integration**: Seamlessly integrate with FastAPI applications.
- **Flask Integration**: Seamlessly integrate with Flask applications.
## License
[MIT](https://github.com/remarkablemark/novu-framework/blob/master/LICENSE)