Skip to main content

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

Project description

PyroRatnaGram
Telegram MTProto API Framework for Python
Homepage Documentation Issues Support Chat News/Releases

PyroRatnaGram

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

from pyrogram import Client, filters

app = Client("my_account")


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


app.run()

PyroRatnaGram 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.

Most Important Changes

  • KeyboardButton now supports style and icon_custom_emoji_id for richer reply keyboards.
  • Available ButtonStyle colors are PRIMARY (blue), DANGER (red), and SUCCESS (green).
  • Callback query handlers now support clear priority flow with group usage.
  • Documentation and project links were updated to the current PyroRatnaGram endpoints.

Breaking Changes

  • Package publishing identity is now pyroratnagram. Use pip3 install -U pyroratnagram for new installs and upgrades.
  • For private incoming text handlers, command exclusion should be moved to decorator-level filtering.

Old style:

@Client.on_message(filters.private & filters.text & filters.incoming)
async def pm_search(client, message):
    if str(message.text).startswith('/'):
        return

Recommended style:

@Client.on_message(filters.private & filters.text & filters.incoming & filters.regex(r"^(?!/)"))
async def pm_search(client, message):
    ...

Why this change matters: it prevents unnecessary handler execution, keeps handlers cleaner, and reduces logic duplication.

For the full list of updates, see CHANGELOG.md.

Key Features

  • Ready: Install PyroRatnaGram 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

pip3 install -U pyroratnagram

Resources

  • Check out the docs at https://pyroratna.ratna.pw to learn more about PyroRatnaGram, get started right away and discover more in-depth material for building your client applications.
  • Join the official Telegram Channel at https://t.me/official_RATNA and stay tuned for news, updates and announcements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyroratnagram-1.1.0.tar.gz (950.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyroratnagram-1.1.0-py3-none-any.whl (5.3 MB view details)

Uploaded Python 3

File details

Details for the file pyroratnagram-1.1.0.tar.gz.

File metadata

  • Download URL: pyroratnagram-1.1.0.tar.gz
  • Upload date:
  • Size: 950.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyroratnagram-1.1.0.tar.gz
Algorithm Hash digest
SHA256 89c9235c349f13076765ccac44233e7002dc03cbabed9f629e90eeb0ced01488
MD5 1117b9360978b4186b064a367d087988
BLAKE2b-256 0fc0c869953460ee7761296abbd1d63134631d09d02cf3913705f021838df502

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyroratnagram-1.1.0.tar.gz:

Publisher: python-publish.yml on AnmolRatna25/PyroRatnaGram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyroratnagram-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyroratnagram-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyroratnagram-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 feb54fc5901bdcfe000a92620c0d17639a21ed3b7c4ec26cd6dbb2dbdc309d3c
MD5 146d3d440ad1c61b4d2fc51bdcc3005e
BLAKE2b-256 1b19a35af18ec92a9c283eb36ee98f88cfed9a078b8b9dcbe105e962aa0820fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyroratnagram-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on AnmolRatna25/PyroRatnaGram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page