Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

⚡ 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.dev1

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.dev1
File Size Uploaded
stdgram-1.0.0.dev1.tar.gz 1.4 MB Details

Built distribution (wheel)

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

Total release size: 7.7 MB

Release files / stdgram-1.0.0.dev1.tar.gz

Download URL stdgram-1.0.0.dev1.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
2ba55d96083bc352433a1c897a1cde00ceceb69fb9db0bc23421f511582c47c7
BLAKE2b-256 checksum
How to use checksums
47d6d64ab26b431fd891e20c25115b27d4458d00742e7a99c1cb5e266778b1a7
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.dev1-py3-none-any.whl

Download URL stdgram-1.0.0.dev1-py3-none-any.whl
Size 6.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7adcc96425ff44235548a5ef498a91c77bddede50fdd568a522677e7d32c6653
BLAKE2b-256 checksum
How to use checksums
e4a74ee63073f449667d9cad8a81234d91a66819cb1e93ca718c92a09e313c63
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

1.0.0

2 release files

This release

1.0.0.dev1 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