LazyHooks
A lightweight, standalone Python package for sending and receiving webhooks with optional persistence.
Features
- Simple API: Send webhooks with minimal boilerplate.
- Async First: Built on
asyncioandaiohttpfor high performance. - Secure: HMAC-SHA256 signing with Timestamp Replay Protection.
- Reliable: Optional
SQLitestorage to persist and retry failed webhooks.
Security
LazyHooks prioritizes security by design:
- Replay Protection: All webhooks include a timestamp. Requests older than 5 minutes are rejected.
- HMAC-SHA256: Signatures verify both the body and the timestamp (
timestamp.body) to prevent tampering. - Constant-Time Verification: Prevents timing attacks.
- SQL Injection Safe: Parameterized queries.
headers:
X-Lh-Timestamp: Unix timestamp of the request.X-Lh-Signature:v1=...(HMAC oftimestamp.body)
Documentation
Beginner Tutorials (Start Here!)
- What are Webhooks?: The basics explained simply.
- Installation: Quick setup guide.
- Your First Webhook: Send "Hello World" in 2 minutes.
- Receiving Webhooks: Listen for events securely.
- Testing with Tunnels: Go live with ngrok.
Core Documentation
- Getting Started: Installation and quick examples.
- Sending Webhooks: Sending usage.
- Receiving Webhooks: Receiver usage.
- Storage & Retries: Persistence and reliability.
- Security: Security details.
- Comparisons: Alternatives analysis.
- API Reference: API docs.
Quick Example
Sending
import asyncio
from lazyhooks import WebhookSender
async def main():
sender = WebhookSender(signing_secret="super-secret")
await sender.send("https://example.com/webhook", {"event": "hello"})
asyncio.run(main())
Receiving
from lazyhooks import verify_signature
def handle_webhook(request):
timestamp = request.headers.get("X-Lh-Timestamp")
signature = request.headers.get("X-Lh-Signature")
body = request.body
if verify_signature(body, signature, "super-secret", timestamp):
return "OK", 200
else:
return "Invalid Signature or Timestamp", 401
Links
- PyPI: https://pypi.org/project/lazyhooks
- Issues: https://github.com/StackTactician/LazyHooks/issues
- Documentation: See the GitHub repo for full docs, advanced usage, and examples.
Metadata
Release files for lazyhooks 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lazyhooks-0.2.3.tar.gz | 24.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lazyhooks-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.1 kB
Release files / lazyhooks-0.2.3.tar.gz
| Download URL | lazyhooks-0.2.3.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d9e08db87908a35b2d9aa716d59e7c045006cf963fe1669d8fab2942c5fcafc
|
|
BLAKE2b-256 checksum How to use checksums |
5fc1d5ab39d36cfdd9fa6fd4d57e02cf48c17d19be3e0ed76862f4eb81e154aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / lazyhooks-0.2.3-py3-none-any.whl
| Download URL | lazyhooks-0.2.3-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
709df3291550543c1e0c87625f670250d955009e0f91527e5d9e472f352e932e
|
|
BLAKE2b-256 checksum How to use checksums |
771a841543d894a92ed48bd8f344613699cb9d208f20faa19b8cb867e576d1de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for lazyhooks 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.