Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secnex_notion_webhook_server-0.0.3.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secnex_notion_webhook_server-0.0.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file secnex_notion_webhook_server-0.0.3.tar.gz.

File metadata

File hashes

Hashes for secnex_notion_webhook_server-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6ed00496a62c4deb3e9940a8a2a31810c9e1462ed4bbe3afd17874c7b4bb35a8
MD5 d9641ec94e0ee2f77704532ffc033e3c
BLAKE2b-256 6403fcf89d6c93a4aae5eab23f191e132440a32eea1278867b6bce7f4a82ed20

See more details on using hashes here.

File details

Details for the file secnex_notion_webhook_server-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for secnex_notion_webhook_server-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b3e15ca0d9afe9cd6af3e526d9989bbb6bf0df1e3cb885ebbe30360839e80a9
MD5 640d54477af1ad65c9ddc8b9fa775339
BLAKE2b-256 7b30affa00e78d3d2caef866388053f31ffc310d82afa72be189c7e72d7b5bb1

See more details on using hashes here.

Supported by

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