aiogram-lazy-kb 🎹
Простая обертка для быстрого создания клавиатур в aiogram 3.x.
Забудьте о KeyboardBuilder, adjust() и импортах кнопок для простых задач.
Установка
pip install aiogram-lazy-kb
Использование
1. Reply Клавиатура (Кнопки меню)
Python
from aiogram_lazy_kb import LazyKeyboard
# Простая сетка 2 кнопки в ряд
kb = LazyKeyboard.reply(
buttons=["Меню", "Помощь", "О нас", "Контакты"],
sizes=2,
placeholder="Выберите пункт..."
)
# Сложная схема: 2 кнопки в первом ряду, 1 во втором
kb_complex = LazyKeyboard.reply(
buttons=["Кнопка 1", "Кнопка 2", "Кнопка 3 (во всю ширь)"],
sizes=[2, 1]
)
2. Inline Клавиатура (Кнопки под сообщением)
Поддерживает автоматическое определение ссылок (URL).
Python
# Передаем словарь: Текст -> callback_data
kb = LazyKeyboard.inline(
data={
"Лайк": "like_action",
"Дизлайк": "dislike_action",
"Наш сайт": "https://google.com" # Автоматически станет url-кнопкой
},
sizes=2
)
Требования
Python 3.9+
aiogram 3.x
text
---
### Как протестировать перед заливкой
Создай рядом с папкой `src` файл `test_bot.py` (не заливай его на PyPI, это для тебя):
```python
import asyncio
from aiogram import Bot, Dispatcher, types
from aiogram.filters import Command
# Импортируем наш локальный модуль (симуляция)
import sys
import os
sys.path.insert(0, os.path.abspath("src"))
from aiogram_lazy_kb import LazyKeyboard
# Вставь сюда токен тестового бота
TOKEN = "YOUR_BOT_TOKEN"
dp = Dispatcher()
bot = Bot(token=TOKEN)
@dp.message(Command("start"))
async def cmd_start(message: types.Message):
# Тест Reply
kb = LazyKeyboard.reply(["Каталог", "Корзина", "Инфо"], sizes=[2, 1], placeholder="Жми!")
await message.answer("Привет! Вот reply клавиатура:", reply_markup=kb)
# Тест Inline
kb_inline = LazyKeyboard.inline({
"Купить": "buy_item",
"Ссылка": "https://ya.ru"
}, sizes=2)
await message.answer("А вот inline:", reply_markup=kb_inline)
async def main():
await dp.start_polling(bot)
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for aiogram-lazy-kb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiogram_lazy_kb-0.1.0.tar.gz | 3.2 kB | Without provenance | Details for aiogram_lazy_kb-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiogram_lazy_kb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for aiogram_lazy_kb-0.1.0-py3-none-any.whl |
Total release size: 7.3 kB
Release files / aiogram_lazy_kb-0.1.0.tar.gz
| Download URL | aiogram_lazy_kb-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ce285bcd488a41db54b28986db7774ef51525da3dcca03965a1abd1dd0cbca0
|
|
BLAKE2b-256 checksum How to use checksums |
a515ac6b9c210c5101e27cc5c498d07a8ba81d9602dc1765f410e9f67d5ff2d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / aiogram_lazy_kb-0.1.0-py3-none-any.whl
| Download URL | aiogram_lazy_kb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9eb39d416a0f33a010f690b4799e80bf0e8f329e063e3cbe489047d8da9d5478
|
|
BLAKE2b-256 checksum How to use checksums |
a0c898a5e0be8263f80a8c937de1c25ed08a3c842bf662f0fc6c8d80229ffec1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Security for aiogram-lazy-kb 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.