Generates command documentation from handlers
Project description
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()
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
aiogram_autodoc-0.0.2.tar.gz
(15.2 kB
view details)
File details
Details for the file aiogram_autodoc-0.0.2.tar.gz
.
File metadata
- Download URL: aiogram_autodoc-0.0.2.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da93642516ec7ad461b850dd76e543583f516856fef16900aa7dc8e2470a778a |
|
MD5 | ffba524a1d19d14e9c06c4efc7f99eb5 |
|
BLAKE2b-256 | 80f9793a01392c78260ae6f67e7ec6813ca1c2af9f86e05a7eb73faace7e9cca |