Skip to main content

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

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)

Source distribution for lazyhooks 0.2.3
File Size Uploaded Provenance
lazyhooks-0.2.3.tar.gz 24.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lazyhooks 0.2.3
File Interpreter ABI Platform
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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page