Skip to main content

A modern, type-hinted Python library for seamless interaction with the Discord Webhook API.

Project description

Clyde

Python GitHub Workflow Status PyPI Downloads Coverage Report

Clyde is a modern, type-hinted Python library for seamless interaction with the Discord Webhook API.

It's lightweight, developer-friendly, and supports advanced features like Components and Embeds.

Features

  • Fully type-hinted for an excellent developer experience
  • Input validation powered by msgspec
  • Support for all Webhook-compatible Components
  • Granular customization of rich Embeds
  • Helpers for Discord-flavored markdown, including timestamps
  • Compatible with both synchronous and asynchronous HTTP requests
  • Seamless automatic retries when encountering Discord rate limits
  • Beautiful generated documentation built with Zensical

Getting Started

Installation

[!IMPORTANT] Clyde requires Python 3.11 or later.

Install with uv (recommended):

uv add discord-clyde

Alternatively, install with pip:

pip install discord-clyde

Examples

[!TIP] Take the examples below and copy/paste them into your project to get started in seconds.

Send a standard Message

from clyde import Webhook

relay: Webhook = Webhook(url="https://discord.com/api/webhooks/00000/XXXXXXXXXX")

relay.set_avatar_url("https://i.imgur.com/RzkhQgZ.png")
relay.set_username("Heisenberg")

relay.set_content("[Clyde](https://github.com/EthanC/Clyde) says hi!")

relay.execute()

Preview

Send a Message with Components

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

relay: Webhook = Webhook(url="https://discord.com/api/webhooks/00000/XXXXXXXXXX")

relay.set_avatar_url("https://i.imgur.com/BpcKmVO.png")
relay.set_username("TARS")

greeting: TextDisplay = TextDisplay(content="[Clyde](https://github.com/EthanC/Clyde) says hi!")

actions: ActionRow = ActionRow()
repository: LinkButton = LinkButton()

repository.set_label("Try Clyde")
repository.set_url("https://github.com/EthanC/Clyde")

actions.add_component(repository)
relay.add_component(greeting)
relay.add_component(actions)
relay.execute()

Preview

Send a Message with an Embed

from clyde import Embed, Webhook


relay: Webhook = Webhook(url="https://discord.com/api/webhooks/00000/XXXXXXXXXX")

relay.set_avatar_url("https://i.imgur.com/QaTHttz.png")
relay.set_username("Shady")

rich: Embed = Embed()

rich.set_description("[Clyde](https://github.com/EthanC/Clyde) says hi!")
rich.set_color("#5865F2")

relay.add_embed(rich)
relay.execute()

Preview

Releases

Clyde loosely follows Semantic Versioning for consistent, predictable releases.

Contributing

Contributions are welcome - whether it’s fixing bugs or adding new features.

Acknowledgments

The Clyde character and Discord brand assets are owned by Discord.

This project is not affiliated with or endorsed by Discord in any way.

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

discord_clyde-0.6.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-0.6.0-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: discord_clyde-0.6.0.tar.gz
  • Upload date:
  • Size: 7.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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-0.6.0.tar.gz
Algorithm Hash digest
SHA256 fe517f0c12e1236a37c32dddb22424cb6fdb648b14428c8ba68f658a360c8616
MD5 300631f50ac4e3a085807af994f99f12
BLAKE2b-256 04cbbbfed1f99d65ba7b6cfffd04a3993f82d33a76eb07d48eec93c06b5b484d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: discord_clyde-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05741aa1f5269916ebdbc9693e29e397a9aa9029ed113540c1b397a4462b0edc
MD5 9981238c732a5f4abc1ec617d5629ce9
BLAKE2b-256 006e043587010db374aa895a29af846598e397786b949787ba8981331b0eab5a

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