Skip to main content

pulse.py (pulse-voice on PyPI)

The official async Python SDK for Pulse bots and integrations.

Le SDK officiel et asynchrone pour écrire des bots Pulse en Python. Documentation complète en français : https://pulse.shadowforge.fr/developpeurs/pulse-py.

  • Python 3.9+, asyncio and aiohttp, fully typed (py.typed)
  • REST client with per-bucket rate limits, Retry-After handling and retries
  • Gateway: heartbeats, zombie detection, resume, reconnection with backoff, intents
  • Events with decorators: @client.event async def on_message_create(message): ...
  • Slash commands with @client.command, context menus, buttons, select menus, modals, autocomplete
  • Embed builder with Pulse's limits checked before sending
  • Webhook for incoming webhooks, interactions_app for an HTTP interactions endpoint

Install

pip install pulse-voice
python -m pip install pulse-voice      # same thing, with the pip of this Python
py -m pip install pulse-voice          # Windows
poetry add pulse-voice
uv add pulse-voice
pipenv install pulse-voice
pip install -U pulse-voice             # upgrade

The distribution is called pulse-voice; the import name is pulse (import pulse). For HTTP interactions (signature checks), install the extra: pip install "pulse-voice[interactions]".

Quick start

Create an application in the developer portal, add a bot, copy its token, then:

import os
import pulse

client = pulse.Client(intents=pulse.Intents.default() | pulse.Intents.MESSAGE_CONTENT)

@client.event
async def on_ready():
    print(f"Connected as {client.user.username}")

@client.event
async def on_message_create(message: pulse.Message):
    if message.author.bot:
        return
    if message.content == "!ping":
        await message.reply("pong")

client.run(os.environ["PULSE_TOKEN"])

Slash commands

@client.command(
    description="Le bot répète ta phrase",
    options=[pulse.Option.string("texte", "Quoi dire", required=True)],
)
async def dire(interaction: pulse.Interaction, texte: str):
    await interaction.reply(texte)

@client.event
async def on_ready():
    await client.sync_commands(hub_id=os.environ.get("PULSE_HUB_ID"))  # None: global commands

Webhooks

import asyncio, os, pulse

async def main():
    async with pulse.Webhook.from_url(os.environ["PULSE_WEBHOOK_URL"]) as hook:
        await hook.send("Build OK", username="CI", embed=pulse.Embed(title="Vert", color="#3ddc97"))

asyncio.run(main())

Errors and rate limits

API errors raise pulse.PulseAPIError with status, code (for example MISSING_PERMISSIONS) and a French message. 429 answers are retried after Retry-After. Handler errors go to on_error(event, error) when you define it.

Examples

See examples/: a ping bot, a slash command bot with a button and a modal, a webhook script.

License

MIT

Metadata

Release files for pulse-voice 2.0.0

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

Source distribution (sdist)

Source distribution for pulse-voice 2.0.0
File Size Uploaded Provenance Actions
pulse_voice-2.0.0.tar.gz 37.9 kB Without provenance Details for pulse_voice-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pulse-voice 2.0.0
File Interpreter ABI Platform Actions
pulse_voice-2.0.0-py3-none-any.whl Python 3 none any Details for pulse_voice-2.0.0-py3-none-any.whl

Total release size: 71.6 kB

Release files / pulse_voice-2.0.0.tar.gz

Download URL pulse_voice-2.0.0.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
22889c3bde5710930dd3151aa6059eac6c65580afbabed24d13929a470dc4a40
BLAKE2b-256 checksum
How to use checksums
6a23ee757a7cbc006c4b974240be5182ed3b8c74e464783b70d3e813f3d45ffe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / pulse_voice-2.0.0-py3-none-any.whl

Download URL pulse_voice-2.0.0-py3-none-any.whl
Size 33.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbf985ae6d56a4a69558894e325c8de060b23a0e02eb7a4cb265db33667167f0
BLAKE2b-256 checksum
How to use checksums
f5090085411bb85a7dd986cb4194f614e58f9a07f7f284c263baa470ef3e05b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for pulse-voice 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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