Metadata-Version: 2.1
Name: Pyrography
Version: 1.0.2
Summary: A Pyrogram fork inspired by Pyromod & AmanoTeam/Pyrogram.
Home-page: https://github.com/d3cryptofc/pyrography
Download-URL: https://github.com/d3cryptofc/pyrography/releases/latest
Author: Lelzin λ
Author-email: d3cryptofc@gmail.com
License: LGPLv3
Project-URL: Tracker, https://github.com/d3cryptofc/pyrography/issues
Project-URL: Community, https://t.me/forkpyrography
Project-URL: Source, https://github.com/d3cryptofc/pyrography
Project-URL: Documentation, https://docs.pyrogram.org
Keywords: telegram chat messenger mtproto api client library python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet
Classifier: Topic :: Communications
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: ~=3.7
Description-Content-Type: text/markdown
License-File: COPYING
License-File: COPYING.lesser
License-File: NOTICE
Requires-Dist: pyaes (==1.6.1)
Requires-Dist: pysocks (==1.7.1)
Requires-Dist: rich (~=13.4.2)
Requires-Dist: TgCrypto (~=1.2.5)

<p align="center">
    <a href="https://github.com/pyrogram/pyrogram">
        <img src="https://github.com/d3cryptofc/pyrography/assets/47941854/0eb90a78-5054-497e-8c86-b5f6bbb70822" alt="Pyrogram" width="128">
    </a>
    <br>
    <b>Telegram MTProto API Framework for Python</b>
    <br/>A wonderful Pyrogram fork inspired by Pyromod & AmanoTeam/Pyrogram
    <br>
    <a href="https://github.com/d3cryptofc/pyrography/releases">
        Releases
    </a>
    •
    <a href="https://t.me/forkpyrography">
        News
    </a>
</p>

## Pyrography

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

```python3
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](https://docs.pyrogram.org/topics/mtproto-vs-botapi)
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](https://pypi.org/project/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](https://pypi.org/project/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](https://pypi.org/project/rich/))
Enabled by default, but you can to disable it setting **log_level** parameter to `logging.NOTSET`.

[Read more here](https://rich.readthedocs.io/en/stable/logging.html).

##### 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:

- [Become a GitHub sponsor](https://github.com/sponsors/delivrance).
- [Become a LiberaPay patron](https://liberapay.com/delivrance).
- [Become an OpenCollective backer](https://opencollective.com/pyrogram).

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