Skip to main content

Python client for Relayed, a webhook delivery service

Project description

Relayed

A Python Client for Relayed, a Webhooks Delivery Service.

Installation

pip install relayed

Quick start

import uuid
from relayed import RelayedClient, RelayedClientError

client = RelayedClient(
    api_key="your-api-key",
    base_url="https://relayed.example.com",
    )

subscription = client.create_subscription(
        destination_url="https://example.com",
        event_types=["invoice.paid", "invoice.unpaid"],
        description="Subscription for a contractor to send webhook whether customer paid the invoice"
    )
try:
    response = client.send_event(
        event_type="invoice.paid",
        payload={"invoice_id": "inv_123", "amount": 4200},
        idempotency_key=str(uuid.uuid4()),  # use a stable value across retries
    )
    print(response)  # {"event_id": "...", "delivery_ids": [...]}
except RelayedClientError as e:
    print(f"Cannot send event: {e}")

Error Handling

All errors raised by the SDK inherit from RelayedError, so you can catch everything with a single except clause, or catch specific subclasses for fine-grained handling.

from relayed import (
    RelayedError,
    RelayedAuthError,
    RelayedNotFoundError,
    RelayedConflictError,
    RelayedClientError,
    RelayedServerError,
)

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

relayed-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

relayed-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file relayed-0.1.0.tar.gz.

File metadata

  • Download URL: relayed-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for relayed-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5cdc3bc8b703d9fd5f66e291e78b4cf8f4b69431cc41b80b0302bca76c3f6fbd
MD5 881a685011c595c60552aed57b957eee
BLAKE2b-256 a4ca100723efb7c2dce7d3f3678446b67d0aca5494db212c5f4fa5a6fb7cadb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on JoeCosta7/Relayed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file relayed-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: relayed-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for relayed-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 131fc1954887c75cb5edd7d13d65e5b56869a4085fba015f9ac51bf2fc9b7e6d
MD5 e1378201714982227414dbce4547cea1
BLAKE2b-256 588495a942ad341e793d95e10b0a6c86fb0623237678c7ef0fd90b83b97a7ae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on JoeCosta7/Relayed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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