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()
Release files for aiogram-autodoc 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiogram_autodoc-0.0.2.tar.gz | 15.2 kB | Details |
Release files / aiogram_autodoc-0.0.2.tar.gz
| Download URL | aiogram_autodoc-0.0.2.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da93642516ec7ad461b850dd76e543583f516856fef16900aa7dc8e2470a778a
|
|
BLAKE2b-256 checksum How to use checksums |
80f9793a01392c78260ae6f67e7ec6813ca1c2af9f86e05a7eb73faace7e9cca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|