Skip to content

PyKeyboard Documentation

pykeyboard

**Best Keyboard Library for Kurigram**

🚀 What is PyKeyboard?

PyKeyboard is a modern, fully type-safe Python library for creating beautiful and functional inline and reply keyboards for Telegram bots using Kurigram.

✨ Key Features

  • 🌍 50+ Languages - Comprehensive locale support with native language names and flags
  • 📖 Pagination - Advanced pagination with automatic duplicate prevention
  • 🌐 Language Selection - Built-in multi-language keyboard support

📖 Quick Examples

Inline Keyboard

from pykeyboard import InlineKeyboard, InlineButton

# Create a simple inline keyboard
keyboard = InlineKeyboard()
keyboard.add(
    InlineButton("👍 Like", "action:like"),
    InlineButton("👎 Dislike", "action:dislike"),
    InlineButton("📊 Stats", "action:stats")
)

# Use with Kurigram
await message.reply_text("What do you think?", reply_markup=keyboard)

Reply Keyboard

from pykeyboard import ReplyKeyboard, ReplyButton

# Create a reply keyboard
keyboard = ReplyKeyboard(resize_keyboard=True, one_time_keyboard=True)
keyboard.add(
    ReplyButton("Yes"),
    ReplyButton("No"),
    ReplyButton("Maybe")
)

# Use with Kurigram
await message.reply_text("Choose an option:", reply_markup=keyboard)

🎯 Perfect For

  • Telegram Bot Developers - Create beautiful, functional keyboards with ease
  • E-commerce Bots - Product catalogs with pagination and search
  • Menu-driven Interfaces - Complex navigation systems
  • Multi-language Applications - Built-in language selection
  • Form Handling - User input collection with reply keyboards
  • Interactive Applications - Any bot requiring user interaction

🏗️ Architecture

PyKeyboard provides a clean, modular architecture:

  • Core Classes: InlineKeyboard, ReplyKeyboard, InlineButton, ReplyButton
  • Builder Pattern: KeyboardBuilder for fluent API construction
  • Factory Pattern: KeyboardFactory for common keyboard templates
  • Localization: 50+ language support with automatic detection

🤝 Community & Support

📄 License

This project is licensed under the MIT License - see the LICENSE for details.


Made with ❤️ for the Telegram bot development community