Pyrogram
Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
What it is and what it does
Pyrogram is an asynchronous Python framework that wraps Telegram's MTProto API, allowing you to build custom Telegram clients and bots without using Telegram's official Bot API. It abstracts the low-level protocol details while exposing the full range of Telegram's functionality—sending and receiving messages, handling events, managing chats, and executing actions that a regular Telegram client can perform. The library is designed to be intuitive and type-hinted, supporting both async and synchronous usage patterns.
The framework depends on pyaes for encryption and pysocks for proxy support, and it targets Python 3.7 and later across CPython and PyPy. While the project is marked as Production/Stable, it is now archived and abandoned—the repository accepts no new contributions, and the last release was in April 2023. This means security updates, bug fixes, and compatibility patches with future Telegram protocol changes are unlikely to be provided by the original maintainers.
Use it for:
- Build a custom Telegram client that automates message sending, forwarding, or archiving from a user account.
- Create a bot that responds to messages in private chats or groups with custom logic beyond what the official Bot API allows.
- Scrape or monitor Telegram channels and groups by acting as an authenticated user client.
- Implement Telegram-based workflows that require full API access, such as bulk messaging or account management tools.
- Develop a Telegram notification service that sends alerts or updates to specific chats programmatically.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyrogram is an asynchronous Python framework for interacting with Telegram's MTProto API, enabling you to build custom clients and bots that send messages, handle events, and execute Telegram actions programmatically.
Yes, but with caution. Pyrogram is stable and widely used for Telegram automation, with low install friction and no known security vulnerabilities. However, the project is abandoned—no maintenance since April 2023—so you should only adopt it if you can tolerate the risk that Telegram protocol changes or security issues in dependencies will not be addressed by the original maintainers. If you need active support or plan to rely on this for production systems, investigate maintained forks or alternatives first.
Install
pyrogram on PyPI
pip
pip install pyrogramuv
uv add pyrogrampoetry
poetry add pyrogramInstalling Pyrogram
Before you install
Installation is straightforward with low friction—a pure Python wheel with only two runtime dependencies (pyaes and pysocks). However, the project is archived and abandoned as of late 2024, with no active maintenance; the last release was in April 2023.
License in practice
Pyrogram is licensed under LGPLv3 (copyleft), which requires that any modifications you make to the library itself be shared under the same license, though applications using it as a dependency are not subject to this requirement.
Quickstart
pip install pyrogram
from pyrogram import Client, filters
app = Client("my_account")
@app.on_message(filters.private)
async def hello(client, message):
await message.reply("Hello from Pyrogram!")
app.run()
Requires Python 3.7 or later; you must have valid Telegram credentials (phone number or bot token) and network access to Telegram's servers to authenticate and use the client.
Verify before relying
- Whether the archived repository will accept security patches or bug fixes if vulnerabilities are discovered in dependencies like pyaes or pysocks.
- Current compatibility with Telegram's MTProto protocol—whether recent Telegram client updates have broken the library's functionality.
- Whether community forks or maintained alternatives exist that build on Pyrogram's codebase.
Package facts
| License | LGPLv3 (copyleft) |
| Python support | supports the current Python release (~=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pyaes, pysocks |
| Maintenance | abandoned — 1,202 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 503,487/month — #6,304 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Pyrogram-2.0.106-py3-none-any.whl
Keywords: telegram, chat, messenger, mtproto, api, client, library, python
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
KurigramKurigram is an asynchronous Python framework…
copyleft · top 15,000 on PyPI
pyroforkPyrofork is an asynchronous Python framework…
copyleft · top 15,000 on PyPI
aiogramaiogram is an asynchronous Python framework for…
permissive · top 5,000 on PyPI
TgCryptoTgCrypto provides fast C-based implementations…
copyleft · top 15,000 on PyPI
TelethonTelethon is an asyncio-based Python library…
permissive · top 5,000 on PyPI
pytgcallsEnables Python bots to join Telegram voice…
copyleft · top 5,000 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI
telebotA Telegram bot library with route-based message…
permissive · top 15,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
KangelPluginsManagerManages and distributes plugins for exteraGram…
permissive · top 15,000 on PyPI