aiogram-autodoc-0.0.2
توضیحات
Generates command documentation from handlers
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aiogram-autodoc-0.0.2 |
| نام | aiogram-autodoc |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | viuipan@gmail.com |
| آدرس صفحه اصلی | https://github.com/viuipan/aiogram-autodoc |
| آدرس اینترنتی | https://pypi.org/project/aiogram-autodoc/ |
| مجوز | MIT |
# aiogram-autodoc
This package allows you to generate documentation for handlers processing commands.
Supports docstrings and filter inside the handler (DescriptionFilter).
Example:
```
from aiogram import Bot, Dispatcher
from aiogram.types import Message
from aiogram_autodoc import AutoDoc, DescriptionFilter
BOT_TOKEN = '00000:something-words-in-token'
bot = Bot(BOT_TOKEN, validate_token=False)
dp = Dispatcher(bot)
dp.filters_factory.bind(DescriptionFilter)
@dp.message_handler(commands=['start'], description='Description for the function with the /start command')
async def start(msg: Message):
pass
@dp.message_handler(commands=['help'])
async def help(msg: Message):
"""Description for a function with the /help command, using docstring"""
pass
@dp.message_handler()
async def just_function(msg: Message):
"""Just a function without a command that doesn't output in result"""
pass
docs = AutoDoc(dp)
docs.parse()
result_as_dict = docs.to_dict()
```
نحوه نصب
نصب پکیج whl aiogram-autodoc-0.0.2:
pip install aiogram-autodoc-0.0.2.whl
نصب پکیج tar.gz aiogram-autodoc-0.0.2:
pip install aiogram-autodoc-0.0.2.tar.gz