Dataclass-driven Discord API Wrapper in Python
Project description
Features
- Lightweight core
- Strictly typed
- Rate limit handling
- Automatic session & gateway management
- Automatic sharding
- Predictable event models and resource classes
Your focus is building what you want instead of fighting a framework.
Installation
Install ScurryPy with pip:
pip install scurrypy
Examples
The following examples are quick drop-in starters if you wish to try ScurryPy.
[!TIP] It is recommended to use a
.envfile for bot tokens. More details about using a.envfile here.
Slash Command
# Set TOKEN, APP_ID (bot user ID), and GUILD_ID (for guild command)
# --- Core library imports ---
from scurrypy import Client
from scurrypy.ext.commands import CommandsAddon, ApplicationCommandContext
# --- Setup bot ---
client = Client(token=TOKEN)
commands = CommandsAddon(client, APP_ID)
@commands.slash_command('greet', 'Greet the bot!', guild_ids=[GUILD_ID])
async def on_greet(ctx: ApplicationCommandContext):
await ctx.respond("Hello!")
# --- Run the bot ---
client.run()
Prefix Command (Legacy)
# Set TOKEN and APP_ID (bot user ID)
# --- Core library imports ---
from scurrypy import Client, Intents
from scurrypy.ext.prefixes import PrefixAddon, PrefixCommandContext
client = Client(token=TOKEN, intents=Intents.DEFAULT | Intents.MESSAGE_CONTENT)
prefixes = PrefixAddon(client, APP_ID, '!')
# --- Setup bot ---
@prefixes.listen('ping')
async def on_ping(ctx: PrefixCommandContext):
await ctx.send("Pong!")
# --- Run the bot ---
client.run()
Dependencies
ScurryPy has exactly 3 required dependencies:
- aiohttp (HTTP client)
- websockets (Gateway connection)
- aiofiles (Async file operations)
These dependencies are automatically installed with ScurryPy's pip package.
Learn More
Explore the full documentation for more examples, guides, and API reference.
See the manifesto section for details!
Got some questions? Check out the FAQ page for commonly asked questions!
Looking for changes? See the Changelog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scurrypy-2.3.0.tar.gz.
File metadata
- Download URL: scurrypy-2.3.0.tar.gz
- Upload date:
- Size: 72.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3892101d388562fd1ff4bc0bf48b6fcc6bc74ae4a48835633a1b30b115e58bb
|
|
| MD5 |
a0aa98605c05c305d39b6b232d9d54af
|
|
| BLAKE2b-256 |
30aa3b4a40cf006aa40662abf47ed845e02543e1b485da5fac4c0afaa5163ec4
|
File details
Details for the file scurrypy-2.3.0-py3-none-any.whl.
File metadata
- Download URL: scurrypy-2.3.0-py3-none-any.whl
- Upload date:
- Size: 113.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88a7e9a88b943615eff2ebd5eea979de38f0139d69c09963426708f26e5f5a02
|
|
| MD5 |
4be2656c35e43716dff151831a25d56f
|
|
| BLAKE2b-256 |
f74c09b4492b8b570238dfb4fc94d72bf301be7d3d817c3ca47e6c3593d42e0f
|