Skip to content

Commit d580a78

Browse files
committed
Update Installation page
Hint about asyncio
1 parent 5d4e4a4 commit d580a78

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

docs/source/start/Installation.rst

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,71 @@ by following the instructions at https://pip.pypa.io/en/latest/installing/.
1414
Install Pyrogram
1515
----------------
1616

17-
- The easiest way to install and upgrade Pyrogram is by using **pip**:
17+
- The easiest way to install and upgrade Pyrogram to its latest stable version is by using **pip**:
1818

19-
.. code-block:: bash
19+
.. code-block:: text
2020
2121
$ pip3 install --upgrade pyrogram
2222
23-
- or, with TgCrypto_ (recommended):
23+
- or, with TgCrypto_ as extra requirement (recommended):
2424

25-
.. code-block:: bash
25+
.. code-block:: text
2626
27-
$ pip3 install --upgrade pyrogram[tgcrypto]
27+
$ pip3 install --upgrade pyrogram[fast]
2828
2929
Bleeding Edge
3030
-------------
3131

3232
If you want the latest development version of Pyrogram, you can install it straight from the develop_
3333
branch using this command (you might need to install **git** first):
3434

35-
.. code-block:: bash
35+
.. code-block:: text
3636
3737
$ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git
3838
39+
Asynchronous
40+
------------
41+
42+
Pyrogram heavily depends on IO-bound network code (it's a cloud-based messaging client library after all), and here's
43+
where asyncio shines the most by providing extra performance while running on a single OS-level thread only.
44+
45+
**A fully asynchronous variant of Pyrogram is therefore available** (Python 3.5+ required).
46+
Use this command to install:
47+
48+
.. code-block:: text
49+
50+
$ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git@asyncio
51+
52+
53+
Pyrogram API remains the same and features are kept up to date from the non-async, default develop branch.
54+
55+
56+
.. note::
57+
58+
The idea to turn Pyrogram fully asynchronous is still under consideration, but is wise to expect that in future this
59+
would be the one and only way to work with Pyrogram.
60+
61+
.. raw:: html
62+
63+
<script async
64+
src="https://telegram.org/js/telegram-widget.js?4"
65+
data-telegram-post="Pyrogram/4"
66+
data-width="100%">
67+
</script>
68+
69+
.. centered:: Subscribe to `@Pyrogram <https://t.me/Pyrogram>`_ for news and announcements
70+
3971
Verifying
4072
---------
4173

4274
To verify that Pyrogram is correctly installed, open a Python shell and import it.
4375
If no error shows up you are good to go.
4476

45-
.. code-block:: bash
77+
.. code-block:: python
4678
4779
>>> import pyrogram
4880
>>> pyrogram.__version__
4981
'0.8.0'
5082
5183
.. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto
52-
.. _develop: http://github.com/pyrogram/pyrogram
84+
.. _develop: http://github.com/pyrogram/pyrogram

0 commit comments

Comments
 (0)