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.sqlite El almacén de reservas y el registro de entregas sobre SQLite Ninguno: usa sqlite3
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.3.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.3.0
File Size Uploaded Provenance Actions
omniwebhook-0.3.0.tar.gz 167.2 kB With provenance Details for omniwebhook-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 230.2 kB

Release files / omniwebhook-0.3.0.tar.gz

Download URL omniwebhook-0.3.0.tar.gz
Size 167.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8a847f92c05b8f3a9c44c3985a2c654a30a17553559fe18e17fd26e88b53a971
BLAKE2b-256 checksum
How to use checksums
51e20fd380563022f9311a5b96c132d323a3a4718811680c6f7c62df81cdd8fe
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.3.0-py3-none-any.whl

Download URL omniwebhook-0.3.0-py3-none-any.whl
Size 63.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40d09331a98bfd78aa7791f07e9b7059769742aa17c0f7e22badcd2675de8cf1
BLAKE2b-256 checksum
How to use checksums
10cf8f363ba4a65a62baf6c4c096009b9613fd909de73769bfb8ba4362ade1d0
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.3.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.3.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