Skip to main content

Telegram MTProto API Framework for Python

License

Ravengram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots

Ravengram is a personal Pyrogram-family fork for Python, kept as a drop-in replacement for Pyrogram, with support for the latest Telegram features including Gifts, Stories, Topics, Business Accounts, and more. It is maintained independently so that Telegram API updates can be pulled in without waiting on any upstream release schedule.

from pyrogram import Client, filters

app = Client("my_account")


@app.on_message(filters.private)
async def hello(client, message):
    await message.reply("Hello from Ravengram!")


app.run()

Ravengram is a modern, elegant and asynchronous MTProto API framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity (bot API alternative) using Python.

Key Features

  • Ready: Install Ravengram with pip and start building your applications right away.
  • Easy: Makes the Telegram API simple and intuitive, while still allowing advanced usages.
  • Elegant: Low-level details are abstracted and re-presented in a more convenient way.
  • Fast: Boosted up by TgCrypto, a high-performance cryptography library written in C.
  • Type-hinted: Types and methods are all type-hinted, enabling excellent editor support.
  • Async: Fully asynchronous (also usable synchronously if wanted, for convenience).
  • Powerful: Full access to Telegram's API to execute any official client action and more.

Installing

This is currently a local, unpublished fork. Install it straight from your own clone:

pip install -e .

Optional dependencies

pip install -e ".[fast]"     # TgCrypto and uvloop for better performance
pip install -e ".[qrcode]"   # QR code login support

Once you push this to your own GitHub repo (see the Source/Issues URLs in pyproject.toml), replace the command above with a pip install git+https://github.com/ahmedahah4/ravengram install, or publish it to PyPI under your own package name.

Website

The project site lives in website/ (plain HTML/CSS/JS, no build step) and is published to GitHub Pages by .github/workflows/pages.yml on every push to master that touches it. Preview it locally with python -m http.server -d website.

Keeping it up to date with Telegram's API

Telegram's raw API surface lives in the TL schema files under compiler/api, and the pyrogram.raw layer is generated from them by the compiler package (see the Makefile for the compile target). When Telegram ships new methods/types, update the schema there and re-run the compiler instead of waiting on an upstream release.

Metadata

Release files for Ravengram 2.2.27

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

Source distribution (sdist)

Source distribution for Ravengram 2.2.27
File Size Uploaded
ravengram-2.2.27.tar.gz 867.1 kB Details

Built distribution (wheel)

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

Total release size: 7.1 MB

Release files / ravengram-2.2.27.tar.gz

Download URL ravengram-2.2.27.tar.gz
Size 867.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a0425b961029de950579cf5ac5aeeaf255ffc8a11ea4ab72e34a1c810317469f
BLAKE2b-256 checksum
How to use checksums
9f78e94a7baba28f555dc4e2ddfbce7b496a5b35abc53c032ec44937c1bb4f53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ravengram-2.2.27-py3-none-any.whl

Download URL ravengram-2.2.27-py3-none-any.whl
Size 6.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b52295a2f12e04bb0f959d5eea1927d67549e441dc1d049975e6408a550e733f
BLAKE2b-256 checksum
How to use checksums
80d6f3eaaa28ef56347827f17c5d42a05a104972c9b5183263aaf17907b8418d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2.2.27 This release

2 release files

2.2.26

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