PyKeyboard¶
Features¶
- 50+ Languages
Comprehensive locale support with native names and flag emojis
- Smart Pagination
Automatic page navigation with duplicate prevention and LRU caching
- Builder & Factory
Fluent KeyboardBuilder API and one-line KeyboardFactory presets
- Hooks & Validation
Rule-based button validation and transforms via ButtonValidator
- Structured Errors
Typed error classes with error_code, param, value, and reason
- Full Pyrogram Compat
Drop-in reply_markup= support with zero adapter code
Quick Examples¶
Architecture¶
graph LR
A[Your Bot] --> B[InlineKeyboard / ReplyKeyboard]
A --> C[KeyboardBuilder]
A --> D[KeyboardFactory]
C --> B
D --> B
B --> E[Pyrogram]
F[ButtonValidator] -.-> C
G[KeyboardHookManager] -.-> C | Layer | Components |
|---|---|
| Core | InlineKeyboard, ReplyKeyboard, InlineButton, ReplyButton |
| Builder | KeyboardBuilder — fluent API with chaining |
| Factory | KeyboardFactory — one-line keyboard presets |
| Hooks | ButtonValidator, KeyboardHookManager |
| Errors | PyKeyboardError hierarchy with structured data |
| Locale | 50+ built-in locales + custom locale registration |
Community & Support¶
- GitHub Repository — source code and issues
- GitHub Discussions — community support
- Issue Tracker — bug reports and feature requests
Made with for the Telegram bot development community
MIT License — View on GitHub