|
| 1 | +<p align="center"> |
| 2 | + <a href="https://github.com/pyrogram/pyrogram"> |
| 3 | + <img src="https://i.imgur.com/BOgY9ai.png" alt="Pyrogram"> |
| 4 | + </a> |
| 5 | + <br> |
| 6 | + <b>Telegram MTProto API Framework for Python</b> |
| 7 | + <br> |
| 8 | + <a href="https://docs.pyrogram.ml"> |
| 9 | + Documentation |
| 10 | + </a> |
| 11 | + • |
| 12 | + <a href="https://github.com/pyrogram/pyrogram/releases"> |
| 13 | + Releases |
| 14 | + </a> |
| 15 | + • |
| 16 | + <a href="https://t.me/PyrogramChat"> |
| 17 | + Community |
| 18 | + </a> |
| 19 | + <br> |
| 20 | + <a href="compiler/api/source/main_api.tl"> |
| 21 | + <img src="https://img.shields.io/badge/schema-layer%2097-eda738.svg?longCache=true&colorA=262b30" |
| 22 | + alt="Schema Layer"> |
| 23 | + </a> |
| 24 | + <a href="https://github.com/pyrogram/tgcrypto"> |
| 25 | + <img src="https://img.shields.io/badge/tgcrypto-v1.1.1-eda738.svg?longCache=true&colorA=262b30" |
| 26 | + alt="TgCrypto Version"> |
| 27 | + </a> |
| 28 | +</p> |
| 29 | + |
| 30 | +## Pyrogram |
| 31 | + |
| 32 | +``` python |
| 33 | +from pyrogram import Client, Filters |
| 34 | + |
| 35 | +app = Client("my_account") |
| 36 | + |
| 37 | + |
| 38 | +@app.on_message(Filters.private) |
| 39 | +def hello(client, message): |
| 40 | + message.reply("Hello {}".format(message.from_user.first_name)) |
| 41 | + |
| 42 | + |
| 43 | +app.run() |
| 44 | +``` |
| 45 | + |
| 46 | +**Pyrogram** is an elegant, easy-to-use [Telegram](https://telegram.org/) client library and framework written from the |
| 47 | +ground up in Python and C. It enables you to easily create custom apps for both user and bot identities (bot API alternative) via the [MTProto API](https://core.telegram.org/api#telegram-api). |
| 48 | + |
| 49 | +> [Pyrogram in fully-asynchronous mode is also available »](https://github.com/pyrogram/pyrogram/issues/181) |
| 50 | +> |
| 51 | +> [Working PoC of Telegram voice calls using Pyrogram »](https://github.com/bakatrouble/pytgvoip) |
| 52 | +
|
| 53 | +### Features |
| 54 | + |
| 55 | +- **Easy**: You can install Pyrogram with pip and start building your applications right away. |
| 56 | +- **Elegant**: Low-level details are abstracted and re-presented in a much nicer and easier way. |
| 57 | +- **Fast**: Crypto parts are boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance library |
| 58 | + written in pure C. |
| 59 | +- **Documented**: Pyrogram API methods, types and public interfaces are well documented. |
| 60 | +- **Type-hinted**: Exposed Pyrogram types and method parameters are all type-hinted. |
| 61 | +- **Updated**, to the latest Telegram API version, currently Layer 97 on top of |
| 62 | + [MTProto 2.0](https://core.telegram.org/mtproto). |
| 63 | +- **Pluggable**: The Smart Plugin system allows to write components with minimal boilerplate code. |
| 64 | +- **Comprehensive**: Execute any advanced action an official client is able to do, and even more. |
| 65 | + |
| 66 | +### Requirements |
| 67 | + |
| 68 | +- Python 3.4 or higher. |
| 69 | +- A [Telegram API key](https://docs.pyrogram.ml/intro/setup#api-keys). |
| 70 | + |
| 71 | +### Installing |
| 72 | + |
| 73 | +``` bash |
| 74 | +pip3 install pyrogram |
| 75 | +``` |
| 76 | + |
| 77 | +### Resources |
| 78 | + |
| 79 | +- The Docs contain lots of resources to help you getting started with Pyrogram: https://docs.pyrogram.ml. |
| 80 | +- Reading [Examples in this repository](https://github.com/pyrogram/pyrogram/tree/master/examples) is also a good way |
| 81 | + for learning how Pyrogram works. |
| 82 | +- Seeking extra help? Don't be shy, come join and ask our [Community](https://t.me/PyrogramChat)! |
| 83 | +- For other requests you can send an [Email](mailto:admin@pyrogram.ml) or a [Message](https://t.me/haskell). |
| 84 | + |
| 85 | +### Contributing |
| 86 | + |
| 87 | +Pyrogram is brand new, and **you are welcome to try it and help make it even better** by either submitting pull |
| 88 | +requests or reporting issues/bugs as well as suggesting best practices, ideas, enhancements on both code |
| 89 | +and documentation. Any help is appreciated! |
| 90 | + |
| 91 | +### Copyright & License |
| 92 | + |
| 93 | +- Copyright (C) 2017-2019 Dan Tès <<https://github.com/delivrance>> |
| 94 | +- Licensed under the terms of the [GNU Lesser General Public License v3 or later (LGPLv3+)](COPYING.lesser) |
0 commit comments