Skip to main content

⚡ StdGram

The Next-Generation, Production-Ready MTProto Framework for Python

License: GPL v3 Python Version Telegram MTProto Maintenance

StdGram is an ultra-fast, modern, asynchronous Telegram MTProto API client and bot framework for Python.
Engineered with native Auto-FloodWait handling, Turbo Media transfer, and built-in Conversation states.

Key Features • Installation • Quick Start • License & Attribution • Authors


🚀 Why StdGram?

While traditional MTProto libraries require extensive boilerplate and crash on rate limits, StdGram is engineered as a "batteries-included" framework designed for production stability:

  • 🛡️ Native Auto-FloodWait Queue: No more messy try...except FloodWait blocks. StdGram automatically catches, queues, and safely dispatches messages without crashing.
  • ⚡ Turbo Parallel Media Engine: Up to 3x faster upload and download speeds for large files (up to 4 GB) through concurrent MTProto chunks.
  • 💬 Native Conversations (client.ask): Intuitive multi-step input flows and finite state handling directly in the core client.
  • ☁️ Cloud-Native Storage: Direct support for MongoDB, PostgreSQL, and Redis session strings—eliminating missing local .session file issues on Heroku, Docker, and Render.
  • 🧩 Modular Architecture: Use minimal core MTProto or opt-in to advanced toolkits via pip install stdgram[all].
  • 🔒 Strong Copyleft Protection: Protected under GNU GPLv3 with strict author attribution clauses to prevent closed-source proprietary forks.

📦 Installation

# Standard Core Client
pip install stdgram

# Production Suite (Fast Crypto, Redis, Storage)
pip install stdgram[all]

⚡ Quick Start

1. Simple Bot Example

from stdgram import Client, filters

app = Client(
    "my_bot",
    api_id=12345,
    api_hash="YOUR_API_HASH",
    bot_token="YOUR_BOT_TOKEN"
)

@app.on_message(filters.command("start"))
async def start_handler(client, message):
    await message.reply_text(
        "👋 Welcome! Powered by **StdGram** — The Next-Gen Telegram Engine."
    )

app.run()

2. Interactive Conversation Example (client.ask)

@app.on_message(filters.command("register"))
async def register_user(client, message):
    chat_id = message.chat.id
    
    # Simple 1-line interactive prompt
    name_response = await client.ask(chat_id, "What is your name?")
    user_name = name_response.text
    
    await message.reply_text(f"Welcome aboard, {user_name}!")

StdGram is free software released under the GNU General Public License v3.0 (GPLv3) with Section 7 Additional Terms.

⚠️ Strict Terms for Forks and Derivative Works:

  1. Never Closed-Source: Any project derived from StdGram MUST remain 100% free and open-source under GNU GPLv3. You may NOT privatize or sell proprietary closed forks of this software.
  2. Prominent Credit Required: Any redistribution or modified version must explicitly retain the name StdGram, link to the original repository, and acknowledge STD-DEEPANSHU in the main README and startup console notices.
  3. For full terms, see the LICENSE and NOTICE files.

👥 Authors

Metadata

Release files for stdgram 1.0.0

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

Source distribution (sdist)

Source distribution for stdgram 1.0.0
File Size Uploaded
stdgram-1.0.0.tar.gz 1.4 MB Details

Built distribution (wheel)

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

Total release size: 7.7 MB

Release files / stdgram-1.0.0.tar.gz

Download URL stdgram-1.0.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b17bf5f315f889c2d24b6bd2e981f0fdf0560515b8ee48ba33d7cb46bbe53490
BLAKE2b-256 checksum
How to use checksums
7704c679c28eb242eb7b15eda149149f4b9fdf10b11cb5cb2fe2188e873d6915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / stdgram-1.0.0-py3-none-any.whl

Download URL stdgram-1.0.0-py3-none-any.whl
Size 6.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ef11f0820f155abde1a42e6ac7f140b108c43d1faeac392b9fa9305227539422
BLAKE2b-256 checksum
How to use checksums
1cd1dd33a79797b15a88c05aea909581d55e6e73d1e7d42443a978738010aa0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

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