Telegram MTProto API Framework for Python
A wonderful Pyrogram fork inspired by Pyromod & AmanoTeam/Pyrogram
Releases
•
News
Pyrography
Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
from pyrography import Client, filters
# Creating a client instance to control your bot.
# NOTE: Get your `api_id` and `api_hash` credentials on: my.telegram.org.
# (optional `bot_token` parameter)
client = Client(
name='your_session_name',
api_id=...,
api_hash=...
)
@client.on_message(filters.command('start'))
async def ask_user_name(client, message):
# Ask the user age.
asking = message.ask("What's your name?", quote=True)
# Getting ask message and answer message.
# TIP: you can to use `async for` too!
ask, answer = await anext(asking)
# Getting message text.
user_name = answer.text
# Replying message, without quote.
await answer.reply(f'Nice name, {user_name}!', quote=False)
if __name__ == '__main__':
# Starting client and listening for updates.
client.run()
Pyrography 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.
Why should you use Pyrography?
1. Stop safety
Pyrography is the only mtproto library currently that when pressing CTRL + C to interrupt the program, it will wait for pending commands to finish, preventing anything from being incomplete.
To most performance and others
1. Fast cryptography (TgCrypto)
A Cryptography Library written in C as a Python extension. It is designed to be portable, fast, easy to install and use. TgCrypto is intended for Pyrogram and implements the cryptographic algorithms Telegram requires.
Automatically installed, ignore it.
2. Fast event loop (Uvloop)
A fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood.
Install it, import it and call uvloop.install() in your main script.
3. Wonderful logging (Rich)
Enabled by default, but you can to disable it setting log_level parameter to logging.NOTSET.
4. Low latency
On hosting, choose an region close to Miami to your machine.
Installing
Pypi
python3 -m pip install pyrography
Github
python3 -m pip install git+https://github.com/d3cryptofc/pyrography
Support Official Pyrogram
If you'd like to support the official Pyrogram, you can consider:
Resources
- Check out the docs at https://docs.pyrogram.org to learn more about Pyrogram, get started right away and discover more in-depth material for building your client applications.
- Join the official channel at https://t.me/pyrogram and stay tuned for news, updates and announcements.
Metadata
Release files for Pyrography 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Pyrography-1.0.2.tar.gz | 352.8 kB | Without provenance | Details for Pyrography-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Pyrography-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for Pyrography-1.0.2-py3-none-any.whl |
Total release size: 4.1 MB
Release files / Pyrography-1.0.2.tar.gz
| Download URL | Pyrography-1.0.2.tar.gz |
|---|---|
| Size | 352.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38ad7630286e37e3c9d45eec89a981bce4c1e287870d251db6873af78253d59d
|
|
BLAKE2b-256 checksum How to use checksums |
ec2fe7e8cc4e6317f4506c57bd90ff0118a7057db0d9a78ddc5125dd84cc8a92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / Pyrography-1.0.2-py3-none-any.whl
| Download URL | Pyrography-1.0.2-py3-none-any.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c380847b23d5e4f643c9a93c4db249034295e0982769c725db55e4fe449bc15
|
|
BLAKE2b-256 checksum How to use checksums |
2f2b0cd91c38043aecf68c046164ad5e87bb4b77ec450edca7a9e8d6ed3f53b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for Pyrography 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.