Skip to main content

REPL, hot-reload, keyboards, pagination, and internal dev tools — all in one. That's Raito.

Project description

🔦 Raito

REPL, hot-reload, keyboards, pagination, and internal dev tools — all in one. That's Raito.

GitHub License GitHub Repo stars PyPI - Version
uv Ruff PyPI - Python Version GitHub Actions Workflow Status

Highlights

  • 🔥 Hot Reload — automatic router loading and file watching for instant development cycles
  • 🎭 Role System@raito.roles with pre-configured roles (admin, mod, support, etc) and selector UI
  • 📚 Pagination — easy pagination over text and media using inline buttons
  • 💬 FSM Toolkit — interactive confirmations, questionnaires, and mockable message flow
  • 🚀 CLI Generator$ raito init creates a ready-to-use bot template in seconds
  • 🛠️ Command Registration — automatic setup of bot commands with descriptions for each
  • 🛡️ Rate Limiting — apply global or per-command throttling via decorators or middleware
  • 💾 Database Storages — optional SQL support
  • 🧪 REPL — execute async Python in context (_msg, _user, _raito)
  • 🔍 Params Parser — extracts and validates command arguments
  • 📊 Metrics — inspect memory usage, uptime, and caching stats
  • 📃 Logging — view and filter runtime logs without leaving Telegram
  • 🧰 Debug Utils — run shell commands, monitor jobs, inspect command states, and more

Installation

pip install -U raito

Quick Start

import asyncio

from aiogram import Bot, Dispatcher
from raito import Raito


async def main() -> None:
    bot = Bot(token="TOKEN")
    dispatcher = Dispatcher()
    raito = Raito(dispatcher, "src/handlers")

    await raito.setup()
    await dispatcher.start_polling(bot)


if __name__ == "__main__":
    asyncio.run(main())

Why Raito?

Raito speeds up your bot development by removing the boring parts — no more boilerplate, no more manual restarts, no more duplicated code across projects.
Everything that used to slow you down is already solved.

Showcases

📦 Handling Commands

You can control access to commands using @rt.roles

The @rt.description decorator adds a description to each command — they will show up in the slash menu automatically.

For commands like /ban 1234, use @rt.params to extract and validate the arguments.

@router.message(filters.Command("ban"))
@rt.roles(rt.Role.OWNER, rt.Role.ADMINISTRATOR, rt.Role.MODERATOR)
@rt.description("Ban a user")
@rt.params(user_id=int)
async def ban(message: types.Message, params: rt.Params, bot: Bot):
    if not params.user_id:
        await message.answer("Please provide a user ID.")
        return

    await bot.ban_chat_member(chat_id=message.chat.id, user_id=params.user_id)
    await message.answer(text="✅ User banned successfully!")

🔥 Hot-Reload & Router Management

Whenever you change a file with handlers, Raito automatically reloads it without restarting the bot.

You can also manage your routers manually using the .rt load, .rt unload, .rt reload, or .rt routers commands in the bot.

Your browser does not support the video tag.

🎭 Roles

Use built-in roles to set different access levels for team members.

Roles

Contributing

Have an idea, found a bug, or want to improve something?
Contributions are welcome! Feel free to open an issue or submit a pull request.

Security

If you discover a security vulnerability, please report it responsibly.
You can open a private GitHub issue or contact the maintainer directly.

There’s no bounty program — this is a solo open source project.
Use in production at your own risk.

For full details, check out the Security Policy.

Questions?

Open an issue or start a discussion in the GitHub Discussions tab.
You can also ping @Aidenable for feedback or ideas.

GO TOP

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

raito-1.0.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

raito-1.0.0-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file raito-1.0.0.tar.gz.

File metadata

  • Download URL: raito-1.0.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for raito-1.0.0.tar.gz
Algorithm Hash digest
SHA256 58f6ce852ed0a22b8c111b0c691563ebe637f95371d433f2cef4b34a66bf1fee
MD5 794757a98ef385791f719f123205aa29
BLAKE2b-256 ef4485938db75c371fa486925193c30587637cfbe463b0c12e404a2de3fd3ca0

See more details on using hashes here.

File details

Details for the file raito-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: raito-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for raito-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8375f11cf25a23d4ea6eb3f4dd6fa3a48de463f083468bc03e3eaf158a9701b8
MD5 c2f8e6a5558196b1557e514633773ed8
BLAKE2b-256 a8e3bfa5abf3df2c0b091386b435aacace566185030b7f545492e72f68acd326

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