Skip to main content

Clyde

PyPI version Supported Python versions Build status Coverage report PyPI downloads License

Build rich Discord Webhook API interactions with a typed Python API.

Clyde supports plain messages, Components, and rich Embeds for the Discord Webhook API. It validates each payload and sends it through synchronous or asynchronous HTTP methods.

Features

  • Type annotations across the public API
  • Input type and field validation with msgspec
  • Plain content, every webhook-compatible Discord Component, and field-level Embed controls
  • Helpers for Discord-flavored Markdown and timestamps
  • Synchronous and asynchronous HTTP requests through niquests
  • Automatic retries when Discord returns a rate limit
  • API documentation generated with Zensical

Installation

[!IMPORTANT] Clyde requires Python 3.11 or later.

Add Clyde to a uv project:

uv add discord-clyde

Examples

Plain Message

from clyde import Webhook

Webhook(
    url="https://discord.com/api/webhooks/00000/XXXXXXXXXX",
    avatar_url="https://i.imgur.com/RzkhQgZ.png",
    username="Heisenberg",
    content="[Clyde](https://github.com/EthanC/Clyde) says hi!",
).execute()

Plain message preview

Message With Components

from clyde import Webhook
from clyde.components import ActionRow, LinkButton, TextDisplay

webhook = Webhook(
    url="https://discord.com/api/webhooks/00000/XXXXXXXXXX",
    avatar_url="https://i.imgur.com/BpcKmVO.png",
    username="TARS",
)

webhook.add_component(
    [
        TextDisplay(content="[Clyde](https://github.com/EthanC/Clyde) says hi!"),
        ActionRow(
            components=[
                LinkButton(
                    label="Try Clyde",
                    url="https://github.com/EthanC/Clyde",
                )
            ]
        ),
    ]
).execute()

Component message preview

Message With an Embed

from clyde import Embed, Webhook

Webhook(
    url="https://discord.com/api/webhooks/00000/XXXXXXXXXX",
    avatar_url="https://i.imgur.com/QaTHttz.png",
    username="Shady",
    embeds=[
        Embed(
            description="[Clyde](https://github.com/EthanC/Clyde) says hi!",
            color="#5865F2",
        )
    ],
).execute()

Embed message preview

Releases

Clyde loosely follows Semantic Versioning.

Contributing

Bug fixes and new features are welcome. Read the contribution guide before opening a pull request. Known bugs and feature requests are tracked in GitHub Issues.

Acknowledgments

Discord owns the Clyde character and Discord brand assets. This project is not affiliated with or endorsed by Discord.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discord_clyde-1.0.0.tar.gz (7.9 MB view details)

Uploaded Source

Built Distribution

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

discord_clyde-1.0.0-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

Details for the file discord_clyde-1.0.0.tar.gz.

File metadata

  • Download URL: discord_clyde-1.0.0.tar.gz
  • Upload date:
  • Size: 7.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for discord_clyde-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dc612234f04b243ca1611716970761be7146f9a608d754b4af3c9ea1e9fb7714
MD5 5dcba590d0506173a33c83c219d620f8
BLAKE2b-256 23df6808c57ff7982c249050b5972bedf23baa9c602223eccb02d3cfc6cdd207

See more details on using hashes here.

File details

Details for the file discord_clyde-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: discord_clyde-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 52.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for discord_clyde-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3749910137ef3f7f7b404fff782c41a84c7fda846727fe11c8ad33740529dbee
MD5 88df7250838fdc3c558d534b30ea3ec4
BLAKE2b-256 4e38769cc976ab73bb4ea3cc3b1c25175d4950eb3d22e1ea359db8660c06c994

See more details on using hashes here.

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