Skip to main content

omniwebhook

Webhooks firmados que se emiten y se reciben igual en cualquier stack: verificación, frescura, idempotencia y reintentos con las mismas reglas en Python y en TypeScript.

  • Recibir: verifica la firma, rechaza lo viejo y lo ambiguo, y procesa cada evento una sola vez. Devuelve un resultado tipado en vez de lanzar.
  • Emitir: firma con Standard Webhooks, no entrega a direcciones internas y dice cuándo reintentar.
  • Sincrónico y asincrónico, con tipos completos y sin dependencias obligatorias. Python 3.11 o superior.
pip install omniwebhook

Recibir

import json
import os

from omniwebhook import VerifiedEvent, create_async_receiver, stripe_scheme
from omniwebhook.postgres import AsyncPostgresIdempotencyStore, AsyncPsycopgClient
from omniwebhook.starlette import to_incoming_request, to_response

receive = create_async_receiver(
    verifier=stripe_scheme(secrets=[os.environ.get("STRIPE_WEBHOOK_SECRET", "")]),
    store=AsyncPostgresIdempotencyStore(AsyncPsycopgClient(pool.connection)),
)


@app.post("/webhooks/stripe")
async def stripe_webhook(request: Request) -> Response:
    async def procesar(event: VerifiedEvent) -> None:
        await registrar_pago(json.loads(event.request.body))

    return to_response(await receive.execute(await to_incoming_request(request), procesar))

Esquemas incluidos: stripe_scheme, mercadopago_scheme, github_scheme, creem_scheme, hmac_body_scheme y, en omniwebhook.standard, standard_scheme.

Emitir

import os

from omniwebhook import Delivery, Endpoint, MemoryDeliveryLedger, create_sender, random_message_id
from omniwebhook.standard import standard_signer

send = create_sender(
    signer=standard_signer(secrets=[os.environ.get("WEBHOOK_SIGNING_SECRET", "")]),
    ledger=MemoryDeliveryLedger(),
)

attempt = send.execute(
    Delivery(
        endpoint=Endpoint(id="ep_42", url="https://cliente.example/webhooks"),
        message_id=random_message_id(),
        payload=b'{"type":"pedido.creado"}',
    )
)

Módulos y extras

Módulo Qué trae Extra
omniwebhook Recepción, emisión, esquemas, almacén en memoria y transporte de la biblioteca estándar Ninguno
omniwebhook.standard El formato Standard Webhooks: verificar y firmar omniwebhook[standard]
omniwebhook.postgres El almacén de reservas sobre PostgreSQL omniwebhook[postgres], para el pool de psycopg
omniwebhook.firestore El almacén de reservas sobre Firestore omniwebhook[firestore]
omniwebhook.starlette Ayudas para Starlette y FastAPI omniwebhook[starlette]
omniwebhook.httpx Un transporte asincrónico sobre httpx omniwebhook[httpx]

omniwebhook.standard usa por defecto la librería de referencia del formato. Con signer=native_signer firma con la biblioteca estándar y no hace falta el extra:

from omniwebhook.standard import native_signer, standard_scheme

standard_scheme(secrets=[secreto], signer=native_signer)

Documentación

Licencia

MIT

Metadata

Release files for omniwebhook 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omniwebhook 0.1.0
File Size Uploaded Provenance Actions
omniwebhook-0.1.0.tar.gz 161.1 kB With provenance Details for omniwebhook-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omniwebhook 0.1.0
File Interpreter ABI Platform Actions
omniwebhook-0.1.0-py3-none-any.whl Python 3 none any Details for omniwebhook-0.1.0-py3-none-any.whl

Total release size: 217.3 kB

Release files / omniwebhook-0.1.0.tar.gz

Download URL omniwebhook-0.1.0.tar.gz
Size 161.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0c1221d7b392ce843b0c98d323efa856527112ecd659cec1c1b61ad080f9f484
BLAKE2b-256 checksum
How to use checksums
ba2d2de168c4956e28d3e3756aa94e82a4e47249d6b6bbe6f03757f523ebbd44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / omniwebhook-0.1.0-py3-none-any.whl

Download URL omniwebhook-0.1.0-py3-none-any.whl
Size 56.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16df54c6f703c3cda895316d3468dfa90dcd7670a5762159db9f5039c1e57609
BLAKE2b-256 checksum
How to use checksums
9a0f76d9ef95caacd824c19fd4215d968d343e10f596ab57ed32390279771218
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for omniwebhook 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for omniwebhook-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

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