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.0.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.0.tar.gz.
File metadata
- Download URL: bot_framework-0.1.0.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 |
3525ebdfabf438846f7fb0d3b0a93298cd2e94f026e140282e47399b9ea9802b
|
|
| MD5 |
34bf2763fbb5ead5b12d1d987821a8cf
|
|
| BLAKE2b-256 |
aa5ac6b92cc3ba8dbb01ad7f4206b7f64a43da0071007f50df15795b7ffa3a52
|
File details
Details for the file bot_framework-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bot_framework-0.1.0-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 |
b661d7d16212902c9164a641af372405847e7de794a85279743d64add47e75cb
|
|
| MD5 |
35bd42699539ec4f649bf9145053aaeb
|
|
| BLAKE2b-256 |
ce1f6b8722ed172be8cc981f2ceb628f7b31cfc3ce4b56d526dacefb635dfbbc
|