Skip to main content

Clyde

PyPI version Supported Python versions Build status Coverage report PyPI downloads

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.

Release files for discord-clyde 1.0.1

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

Source distribution (sdist)

Source distribution for discord-clyde 1.0.1
File Size Uploaded
discord_clyde-1.0.1.tar.gz 7.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-clyde 1.0.1
File Interpreter ABI Platform
discord_clyde-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 MB

Release files / discord_clyde-1.0.1.tar.gz

Download URL discord_clyde-1.0.1.tar.gz
Size 7.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f53ef6a48fa43ed06edacf56de8f050b58e86f58c06baf20c9ec5841d1f9a8a3
BLAKE2b-256 checksum
How to use checksums
dccf75700f146c3f58f43d83c5b096b0733e18ac15307d92e872b8ced9391c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

Release files / discord_clyde-1.0.1-py3-none-any.whl

Download URL discord_clyde-1.0.1-py3-none-any.whl
Size 53.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2cd7671103447794e4af8e57e45b8ab147fb7f4b3d9250a2ae4f159160c763a
BLAKE2b-256 checksum
How to use checksums
c98f80f8b5b155a7d9f5180f803028083353a4c7a0a65662e168a0eaee160657
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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