Registry / web-framework / webhook-listener

webhook-listener

JSON →
library1.2.0pypypi✓ verified 85d ago

A lightweight Python web server module to listen for webhooks and forward incoming requests to predefined callback functions. Currently at version 1.2.0, with infrequent releases.

pip install webhook-listener
INSTALL
IMPORT
SIG · WEBHOOK-LISTENER
W
webhook-listener
web-frameworkpythonv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Listener
from webhook_listener import Listener
The package name uses hyphens on PyPI but underscores in Python imports.

Creates a webhook listener on port 8080 with SSL support. The callback receives the parsed JSON body of incoming POST requests.

from webhook_listener import Listener def handle_webhook(data): print("Received:", data) return {"status": "ok"} listener = Listener( port=8080, endpoint="/webhook", callback=handle_webhook, ssl_certificate="/path/to/cert.pem", ssl_key="/path/to/key.pem" ) listener.start()
Debug
Known issues
deprecatedIn v1.0.0 a warning about cherrypy bus on exit was fixed. Older versions may show a stack trace when the listener is stopped.
fix
Upgrade to 1.0.0 or newer.
affects: <1.0.0
gotchaThe import uses underscores (webhook_listener) but the PyPI package name uses hyphens (webhook-listener). Common mistake is to write `import webhook-listener` which is invalid Python syntax.
fix
Use `from webhook_listener import Listener`.
affects: all
gotchaSSL support requires both `ssl_certificate` and `ssl_key` parameters. If only one is provided, the listener crashes.
fix
Provide both files or omit both to run without SSL.
affects: >=1.2.0
Errors
Common errors & fixes
ImportError: No module named webhook_listener
The package installed as 'webhook-listener' but the import uses underscores. This error appears if pip install failed or if import is misspelled.
fix
Run `pip install webhook-listener` and then use `from webhook_listener import Listener`.
cherrypy._cpdispatch.LateParamCallback: The config entry 'tools.sessions.on' refers to an unknown tool
Incorrect configuration or conflicting cherrypy settings when using custom endpoints.
fix
Avoid setting cherrypy config directly; rely on webhook_listener's default config. If error persists, upgrade to latest version.
Upgrade
Version history
1.2.0latest on PyPI · released Dec 14, 2022
Audit
Dependencies
cherrypyrequiredUsed internally as the HTTP server. Automatically installed as a dependency.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
webhook-listener — pip install webhook-listener · libregistry