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.0.3.tar.gz (7.0 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.0.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for relayed-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1d0e402ffeb8d993560b3cd7cf9aeed1e17e4e56290bb3b7b847af8d757f7a5e
MD5 f21fe0c8d3533a6716fa0f630b7573cb
BLAKE2b-256 cbb66e328ac118779ca7e0a1acff8a7301e2034bac77af7aafd1a5a585abae1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.0.3.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.0.3-py3-none-any.whl.

File metadata

  • Download URL: relayed-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ab6bbd9440abd131e7ac0272697701113bcfbc652280a0e4083e97f4b4f3344
MD5 4926e6a05381a9c1ea910cea932d1c72
BLAKE2b-256 edd2bb13d749e2a0f933c23a6ba57e8821a391ee606aa54b1d3ab24f4622f535

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.0.3-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