Reusable Telegram bot framework with Clean Architecture
Project description
Bot Framework
Reusable Python library for building Telegram bots with Clean Architecture principles.
Installation
# Basic installation
pip install bot-framework
# With Telegram support
pip install bot-framework[telegram]
# With all optional dependencies
pip install bot-framework[all]
Features
- Clean Architecture - Layered architecture with import-linter enforcement
- Telegram Integration - Ready-to-use services for pyTelegramBotAPI
- Flow Management - Dialog flow stack management with Redis storage
- Role Management - User roles and permissions
- Language Management - Multilingual phrase support
- Request Role Flow - Pre-built flow for role requests
Quick Start
from bot_framework import Button, Keyboard, IMessageSender
from bot_framework.telegram import TelegramMessageSender
# Create keyboard
keyboard = Keyboard(rows=[
[Button(text="Option 1", callback_data="opt1")],
[Button(text="Option 2", callback_data="opt2")],
])
# Send message (implement IMessageSender or use TelegramMessageSender)
sender.send(chat_id=123, text="Choose an option:", keyboard=keyboard)
Optional Dependencies
telegram- pyTelegramBotAPI for Telegram bot integrationpostgres- psycopg for PostgreSQL database supportredis- Redis for caching and flow state managementall- All optional dependencies
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bot_framework-0.1.2.tar.gz
(24.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bot_framework-0.1.2.tar.gz.
File metadata
- Download URL: bot_framework-0.1.2.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dafa9e57603f58a2d481d1bbc204ac7dc0673d93bd576b2b690513e58f7bcb25
|
|
| MD5 |
efa7e2202fdf0550c22793e1eff95c40
|
|
| BLAKE2b-256 |
ca3576ca48aba518317877f01da36dbf7b1ef926316a8b554b4f7049d0718192
|
File details
Details for the file bot_framework-0.1.2-py3-none-any.whl.
File metadata
- Download URL: bot_framework-0.1.2-py3-none-any.whl
- Upload date:
- Size: 62.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90177d2e90737f86fdb23e41ea11ca380fceaee9607c90c4a98daeceef0a1a5c
|
|
| MD5 |
597eae3d906a3f189c6d786f094426ce
|
|
| BLAKE2b-256 |
01d1e3ec3d62d2556797675ebe9ba8229447f8e493069d86859fc838e0ae5336
|