Python Framework for the Telegram MTProto API
Homepage
•
Documentation
•
Releases
•
News
Hydrogram is a Python library for interacting with the Telegram MTProto API. It provides a simple and intuitive interface for developers to leverage the power of Telegram's API in their Python applications.
To install Hydrogram, you need Python 3 installed on your system. If you don't have Python installed, you can download it from the official website.
To install Hydrogram, use pip:
pip install hydrogram -UHere is a basic example of how to use Hydrogram:
from hydrogram import Client, filters
app = Client("my_account")
@app.on_message(filters.private)
async def hello(client, message):
await message.reply("Hello from Hydrogram!")
app.run()- Easy to use: Hydrogram provides a simple and intuitive interface for developers to leverage the power of Telegram's API in their Python applications, while still allowing advanced usages.
- Elegant: Low-level details are abstracted and re-presented in a more convenient way, making the Telegram API more accessible.
- Fast: Hydrogram is boosted by TgCrypto, a high-performance cryptography library written in C, which makes it faster than other Python Telegram libraries.
- Type-hinted: Types and methods are all type-hinted, enabling excellent editor support and making it easier to write and maintain code.
- Async: Hydrogram is fully asynchronous, which means it can handle multiple requests at the same time, making it faster and more efficient (also usable synchronously if wanted, for convenience).
- Powerful: Hydrogram provides full access to Telegram's API to execute any official client action and more, giving developers the flexibility to build powerful applications.