2018-01-15 11:36:03 +00:00
|
|
|
Welcome to Pyrogram
|
|
|
|
===================
|
|
|
|
|
2017-12-30 18:47:18 +00:00
|
|
|
.. raw:: html
|
|
|
|
|
2018-01-13 16:21:08 +00:00
|
|
|
<p align="right">
|
2018-01-13 16:09:25 +00:00
|
|
|
<a class="github-button" href="https://github.com/pyrogram/pyrogram/subscription" data-icon="octicon-eye" data-size="large" data-show-count="true" aria-label="Watch pyrogram/pyrogram on GitHub">Watch</a>
|
|
|
|
<a class="github-button" href="https://github.com/pyrogram/pyrogram" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star pyrogram/pyrogram on GitHub">Star</a>
|
|
|
|
<a class="github-button" href="https://github.com/pyrogram/pyrogram/fork" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork pyrogram/pyrogram on GitHub">Fork</a>
|
2018-01-13 16:21:08 +00:00
|
|
|
</p>
|
2018-01-13 16:09:25 +00:00
|
|
|
|
2017-12-31 10:03:10 +00:00
|
|
|
<div align="center">
|
2018-01-01 12:55:05 +00:00
|
|
|
<a href="https://pyrogram.ml">
|
|
|
|
<img src="https://pyrogram.ml/images/logo2.png" alt="Logo">
|
|
|
|
</a>
|
2017-12-31 10:03:10 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
<b>Telegram MTProto API Client Library for Python</b>
|
2018-01-13 16:09:25 +00:00
|
|
|
<br>
|
|
|
|
<a href="https://pypi.python.org/pypi/Pyrogram">
|
|
|
|
Download
|
|
|
|
</a>
|
|
|
|
•
|
|
|
|
<a href="https://github.com/pyrogram/pyrogram">
|
|
|
|
Source code
|
|
|
|
</a>
|
|
|
|
•
|
|
|
|
<a href="https://t.me/PyrogramChat">
|
|
|
|
Community
|
|
|
|
</a>
|
2018-01-10 19:56:43 +00:00
|
|
|
<br><br>
|
2018-01-13 16:09:25 +00:00
|
|
|
<a href="https://github.com/pyrogram/pyrogram/blob/master/compiler/api/source/main_api.tl">
|
2018-01-10 19:56:43 +00:00
|
|
|
<img src="https://www.pyrogram.ml/images/scheme.svg"
|
|
|
|
alt="Scheme Layer 74">
|
|
|
|
</a>
|
|
|
|
<a href="https://core.telegram.org/mtproto">
|
|
|
|
<img src="https://www.pyrogram.ml/images/mtproto.svg"
|
|
|
|
alt="MTProto v2.0">
|
|
|
|
</a>
|
2017-12-31 10:03:10 +00:00
|
|
|
</p>
|
2017-12-30 18:47:18 +00:00
|
|
|
|
2018-01-10 19:56:43 +00:00
|
|
|
About
|
2018-01-15 11:36:03 +00:00
|
|
|
-----
|
2018-01-10 19:56:43 +00:00
|
|
|
|
|
|
|
Pyrogram is a fully functional Telegram Client Library written from the ground up in Python.
|
|
|
|
It offers **simple** and **complete** access to the Telegram Messenger API and is designed for Python developers
|
|
|
|
keen on building custom Telegram applications.
|
|
|
|
|
|
|
|
Features
|
|
|
|
--------
|
|
|
|
|
|
|
|
- **Easy to setup**: Pyrogram can be easily installed and upgraded using **pip**, requires
|
|
|
|
a minimal set of dependencies (which are also automatically managed) and very few lines
|
|
|
|
of code to get started with.
|
|
|
|
|
|
|
|
- **Easy to use**: Pyrogram provides idiomatic, developer-friendly, clean and readable
|
|
|
|
Python code (either generated or hand-written) making the Telegram API simple to use.
|
|
|
|
|
|
|
|
- **High level**: Pyrogram automatically handles all the low-level details of
|
|
|
|
communication with the Telegram servers by implementing the
|
2018-01-13 16:09:25 +00:00
|
|
|
`MTProto Mobile Protocol v2.0`_ and the mechanisms needed for establishing
|
2018-01-10 19:56:43 +00:00
|
|
|
a reliable connection.
|
|
|
|
|
2018-01-13 16:09:25 +00:00
|
|
|
- **Updated**: Pyrogram makes use of the latest Telegram API version, currently `Layer 74`_.
|
2018-01-10 19:56:43 +00:00
|
|
|
|
|
|
|
- **Documented**: Pyrogram API public methods are documented and resemble the well
|
|
|
|
established Telegram Bot API, thus offering a familiar look to Bot developers.
|
|
|
|
|
|
|
|
- **Full API support**: Beside the simple, bot-like methods offered by the Pyrogram API,
|
|
|
|
the library also provides a complete, low-level access to every single Telegram API method.
|
|
|
|
|
2018-01-06 11:18:15 +00:00
|
|
|
Preview
|
|
|
|
-------
|
2017-12-30 18:47:18 +00:00
|
|
|
|
2018-01-06 11:18:15 +00:00
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
from pyrogram import Client
|
|
|
|
|
|
|
|
client = Client("example")
|
|
|
|
client.start()
|
|
|
|
|
|
|
|
client.send_message("me", "Hi there! I'm using Pyrogram")
|
|
|
|
client.send_photo("me", "/home/dan/pic.jpg", "Nice photo!")
|
|
|
|
|
|
|
|
client.stop()
|
|
|
|
|
|
|
|
To get started, press Next.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Getting Started
|
|
|
|
|
|
|
|
getting_started/QuickInstallation
|
|
|
|
getting_started/ProjectSetup
|
|
|
|
getting_started/BasicUsage
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Resources
|
|
|
|
|
|
|
|
resources/TextFormatting
|
|
|
|
resources/UpdateHandling
|
|
|
|
resources/ErrorHandling
|
2017-12-30 18:47:18 +00:00
|
|
|
|
|
|
|
.. toctree::
|
2018-01-06 11:18:15 +00:00
|
|
|
:hidden:
|
2018-01-04 02:05:16 +00:00
|
|
|
:caption: Main Package
|
2018-01-03 17:26:05 +00:00
|
|
|
|
2018-01-04 02:05:16 +00:00
|
|
|
pyrogram/index
|
2018-01-03 17:26:05 +00:00
|
|
|
|
|
|
|
.. toctree::
|
2018-01-06 11:18:15 +00:00
|
|
|
:hidden:
|
|
|
|
:caption: Telegram API
|
2018-01-03 17:26:05 +00:00
|
|
|
|
2018-01-03 17:36:23 +00:00
|
|
|
functions/index
|
2018-01-03 17:26:05 +00:00
|
|
|
types/index
|
2018-01-13 16:09:25 +00:00
|
|
|
|
|
|
|
.. _`MTProto Mobile Protocol v2.0`: https://core.telegram.org/mtproto
|
|
|
|
|
|
|
|
.. _`Layer 74`: https://github.com/pyrogram/pyrogram/blob/master/compiler/api/source/main_api.tl
|