A package to create a webhook server that can be used to handle Notion webhooks and trigger actions
Project description
Notion Webhook Server
This is a simple python package to create a webhook server that can be used to handle Notion webhooks and trigger actions.
Installation
pip install secnex-notion-webhook-server
Usage
Create a new webhook server with only the webhook handler
from notion_webhook.server import WebhookServer
server = WebhookServer()
server.start()
Create a new webhook server with a custom handler
from notion_webhook.server import Server, Handler, WebhookHandler
from notion_webhook.db import TokenDatabase
db = TokenDatabase()
if db.check_first_run():
token_id, token = db.create_token()
print(token)
handler = Handler(WebhookHandler(db).webhook_handler)
handlers = {
"/webhook": handler
}
server = Server(
addr=os.getenv("HOST", "0.0.0.0"),
port=int(os.getenv("PORT", 8000)),
handlers=handlers,
app_name=os.getenv("APP_NAME", "NotionWebhookServer")
)
server.start()
You find the example in the examples folder.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Contact
For questions or support, please contact us at support@secnex.io.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secnex_notion_webhook_server-0.0.3.tar.gz.
File metadata
- Download URL: secnex_notion_webhook_server-0.0.3.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ed00496a62c4deb3e9940a8a2a31810c9e1462ed4bbe3afd17874c7b4bb35a8
|
|
| MD5 |
d9641ec94e0ee2f77704532ffc033e3c
|
|
| BLAKE2b-256 |
6403fcf89d6c93a4aae5eab23f191e132440a32eea1278867b6bce7f4a82ed20
|
File details
Details for the file secnex_notion_webhook_server-0.0.3-py3-none-any.whl.
File metadata
- Download URL: secnex_notion_webhook_server-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b3e15ca0d9afe9cd6af3e526d9989bbb6bf0df1e3cb885ebbe30360839e80a9
|
|
| MD5 |
640d54477af1ad65c9ddc8b9fa775339
|
|
| BLAKE2b-256 |
7b30affa00e78d3d2caef866388053f31ffc310d82afa72be189c7e72d7b5bb1
|