https://github.com/wiltonsr/ptb-pagination
Python inline keyboard pagination for Telegram Bot API
https://github.com/wiltonsr/ptb-pagination
hacktoberfest pagination python-telegram-bot telegram
Last synced: about 1 year ago
JSON representation
Python inline keyboard pagination for Telegram Bot API
- Host: GitHub
- URL: https://github.com/wiltonsr/ptb-pagination
- Owner: wiltonsr
- License: mit
- Created: 2023-11-22T12:28:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-14T18:07:16.000Z (about 1 year ago)
- Last Synced: 2025-05-14T18:15:55.026Z (about 1 year ago)
- Topics: hacktoberfest, pagination, python-telegram-bot, telegram
- Language: Python
- Homepage: https://pypi.org/project/ptb-pagination/
- Size: 250 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ptb-pagination
Python inline keyboard pagination for Telegram Bot API.
Provide an easy way to create number pagination with [Telegram Inline Keyboards](https://core.telegram.org/bots/2-0-intro#new-inline-keyboards) for [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot).

This project is very based on [python-telegram-bot-pagination](https://github.com/ksinn/python-telegram-bot-pagination), thanks [ksinn](https://github.com/ksinn/).
The main difference it's supposed to only work with the [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) library and provide full support to [Arbitrary callback_data](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Arbitrary-callback_data).
## Installation
```bash
pip install ptb-pagination
```
## Usage
```python
from ptb_pagination import InlineKeyboardPaginator
paginator = InlineKeyboardPaginator(
page_count,
current_page=page,
data_pattern='page#{page}'
)
bot.send_message(
chat_id,
text,
reply_markup=paginator.markup,
)
```