Skip to main content

A lightweight Slack bot framework for building modular and maintainable Slack bots.

Project description

Slackle

Slackle Framework PyPI Version Slack + FastAPI Python Version


✨ Slackle up your Slack!

Slackle is a lightweight and magical framework for building Slack apps effortlessly.

→ Visit the Official Website


🚀 Features

  • ⚡️ Slash command routing — Handle /your-command, /like, /magic
  • 💬 Event handling@app_mention, message, reaction_added, etc.
  • 🎨 Slack formatting — Clean markdown and block formatting made easy
  • 🧩 Plugin system — Extend functionality with decorators and custom plugins
  • ⚙️ FastAPI + Slack SDK — Built on proven tools, superfast and flexible

📦 Installation

pip install slackle

🧑‍💻 Getting Started

import os

from slackle import Slackle, SlackleConfig
from slackle.utils.slack import get_user_mention

# Set up slackle configuration
config = SlackleConfig(
    app_token=os.getenv("APP_TOKEN"),
    verification_token=os.getenv("VERIFICATION_TOKEN")
)

# Initialize slackle app
app = Slackle(config=config)

# Add handler for message events
@app.on_event("message")
async def say_hello(slack, user_id, channel_id):
    mention = get_user_mention(user_id)
    print("User ID:", user_id)
    await slack.send_message(
        channel=channel_id,
        message=f"Hello {mention}!",
    )

# Add handler for /say slash command
@app.on_command("/say")
async def say_something(slack, text, user_id, channel_id):
    name = await slack.get_user_name(user_id)
    await slack.send_message(
        channel=channel_id,
        message=f"{name} said: {text}",
    )

📁 See examples/ for more code samples.

🤝 Contribution

We welcome contributions! Check out the Contributing Guide to get started.


🪪 License

MIT License. See the LICENSE file for details.

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

slackle-0.2.4.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

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

slackle-0.2.4-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file slackle-0.2.4.tar.gz.

File metadata

  • Download URL: slackle-0.2.4.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for slackle-0.2.4.tar.gz
Algorithm Hash digest
SHA256 a00312121f18b3b692170e4b7a2e189a44f27c987402d5f73f8c4efa60ef3a60
MD5 cf27dff599deaea11b5f913c933f69e7
BLAKE2b-256 be4b88a83901cb5eb07fe2b8f4e1e8950460b64cbe0bb954fa54219124c0e269

See more details on using hashes here.

File details

Details for the file slackle-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: slackle-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for slackle-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 490a4bc87f53b1abae9388b6a4969f416a63095f05ef28e6045c05c14f9f15b1
MD5 cad06a2ecdebd9a4c50c5a66a5e089ab
BLAKE2b-256 1fd059dbb08c63ae5f7fd841077f1d7200cb6396aee9ec0ec76e35e93a70ed17

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