Skip to main content

A lightweight, resilient webhook sender and receiver.

Project description

LazyHooks

LazyHooks Logo

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 asyncio and aiohttp for high performance.
  • Secure: HMAC-SHA256 signing with Timestamp Replay Protection.
  • Reliable: Optional SQLite storage 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 of timestamp.body)

Documentation

Beginner Tutorials (Start Here!)

  1. What are Webhooks?: The basics explained simply.
  2. Installation: Quick setup guide.
  3. Your First Webhook: Send "Hello World" in 2 minutes.
  4. Receiving Webhooks: Listen for events securely.
  5. Testing with Tunnels: Go live with ngrok.

Core Documentation

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

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

lazyhooks-0.2.3.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

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

lazyhooks-0.2.3-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file lazyhooks-0.2.3.tar.gz.

File metadata

  • Download URL: lazyhooks-0.2.3.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lazyhooks-0.2.3.tar.gz
Algorithm Hash digest
SHA256 5d9e08db87908a35b2d9aa716d59e7c045006cf963fe1669d8fab2942c5fcafc
MD5 78f3aa6b0a4ab06c28e54c5192fd35b5
BLAKE2b-256 5fc1d5ab39d36cfdd9fa6fd4d57e02cf48c17d19be3e0ed76862f4eb81e154aa

See more details on using hashes here.

File details

Details for the file lazyhooks-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: lazyhooks-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lazyhooks-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 709df3291550543c1e0c87625f670250d955009e0f91527e5d9e472f352e932e
MD5 2bd1b52cef21e7d77b92e86bcfbd7843
BLAKE2b-256 771a841543d894a92ed48bd8f344613699cb9d208f20faa19b8cb867e576d1de

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