Skip to main content

Srigram

High-Performance Telegram MTProto API Framework for Python

PyPI version Python versions License Telegram Support


Srigram is an elegant, asynchronous, and deeply customizable Python framework built directly on top of the Telegram MTProto API. It empowers developers to build highly scalable bots and user accounts with minimal boilerplate.


⚡️ Why Srigram?

When building production-grade Telegram applications, you need a framework that doesn't just work, but stays ahead of the curve.

  • Modern UI Support: Natively supports the latest Telegram UI updates, including Bot API 9.4+ colored keyboards (primary, danger, success) and Custom Premium Emojis directly on buttons.
  • High-Concurrency Ready: Engineered from the ground up on Python's asyncio to handle thousands of concurrent updates seamlessly.
  • Unified Ecosystem: Write identical, intuitive code for both standard Bot Accounts and User Accounts (Userbots).
  • Direct MTProto Access: Built for power users. Drop down to raw MTProto schema methods whenever you need precise control over Telegram's backend.

⚙️ Installation

Install Srigram and its core dependencies via PyPI:

pip install -U srigram

Requires Python 3.8 or higher.

🚀 Quick Start

1. The Standard Bot

Building a highly responsive bot takes less than 15 lines of code.

from srigram import Client, filters

app = Client(
    "my_bot",
    api_id=1234567,
    api_hash="your_api_hash_here",
    bot_token="your_bot_token"
)

@app.on_message(filters.command("start") & filters.private)
async def hello(client, message):
    await message.reply_text("Hello from Srigram! 🚀")

if __name__ == "__main__":
    app.run()

2. Advanced: Smart Keyboards & Custom Emojis

Srigram makes it incredibly easy to utilize advanced Telegram UI features natively.

from srigram import Client, filters
from srigram.types import InlineKeyboardMarkup, InlineKeyboardButton

@app.on_message(filters.command("menu"))
async def send_menu(client, message):
    keyboard = InlineKeyboardMarkup(
        [
            [
                InlineKeyboardButton(
                    "Confirm Action", 
                    callback_data="confirm", 
                    style="success", # Renders a green button
                    icon_custom_emoji_id=5368324170671202286 # Native premium emoji support
                )
            ]
        ]
    )
    
    await message.reply_text("Please confirm your action below:", reply_markup=keyboard)

🤝 Contributing & Support

Srigram is actively maintained and thrives on community feedback. Whether you are hunting bugs, proposing features, or just want to show off what you've built:


Engineered with ❤️ by Srijan Majumdar.

Metadata

Release files for srigram 2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for srigram 2.4.1
File Size Uploaded
srigram-2.4.1.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for srigram 2.4.1
File Interpreter ABI Platform
srigram-2.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 MB

Release files / srigram-2.4.1.tar.gz

Download URL srigram-2.4.1.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a9316579de849d2d63d78690dd7de81b510780db20feaa1eaeccf8ce1ca3ed50
BLAKE2b-256 checksum
How to use checksums
2bd1b545af6b9d6e02f70c071083ecf2c7ac3728f00285b962b901752202c83d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / srigram-2.4.1-py3-none-any.whl

Download URL srigram-2.4.1-py3-none-any.whl
Size 4.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9b51919199d72415a704a534d12017ee1eb9ed8972ed36fc4e2593fafe0a111e
BLAKE2b-256 checksum
How to use checksums
c0d310bed0da48e725d983ab2a917be26888a7b14e75456e64b5dce3bf53505b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

2.4.1 This release

2 release files

2.4.0

2 release files

2.3.77

2 release files

2.3.76

2 release files

2.3.73

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page