Skip to content

Commit 538f1e3

Browse files
committed
Deep rewrite: preparing for v1.0
- Pyrogram core is now fully asynchronous - Ditched Python 3.5, welcome 3.6 as minimum version. - Moved all types to pyrogram.types - Turned the Filters class into a module (filters) - Moved all filters to pyrogram.filters - Moved all handlers to pyrogram.handlers - Moved all emoji to pyrogram.emoji - Renamed pyrogram.api to pyrogram.raw - Clock is now synced with server's time - Telegram schema updated to Layer 117 - Greatly improved the TL compiler (proper type-constructor hierarchy) - Added "do not edit" warning in generated files - Crypto parts are executed in a thread pool to avoid blocking the event loop - idle() is now a separate function (it doesn't deal with Client instances) - Async storage, async filters and async progress callback (optional, can be sync too) - Added getpass back, for hidden password inputs
1 parent 2f0a1f4 commit 538f1e3

File tree

367 files changed

+12063
-15068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+12063
-15068
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ unknown_errors.txt
66

77
# Pyrogram generated code
88
pyrogram/errors/exceptions/
9-
pyrogram/api/functions/
10-
pyrogram/api/types/
11-
pyrogram/api/all.py
9+
pyrogram/raw/functions/
10+
pyrogram/raw/types/
11+
pyrogram/raw/base/
12+
pyrogram/raw/all.py
1213

1314
# PyCharm stuff
1415
.idea/

MANIFEST.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ recursive-include pyrogram mime.types schema.sql
55

66
## Exclude
77
prune pyrogram/errors/exceptions
8-
prune pyrogram/api/functions
9-
prune pyrogram/api/types
10-
exclude pyrogram/api/all.py
8+
prune pyrogram/raw/functions
9+
prune pyrogram/raw/types
10+
exclude pyrogram/raw/all.py

README.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,40 @@
2121
## Pyrogram
2222

2323
``` python
24-
from pyrogram import Client, Filters
24+
from pyrogram import Client, filters
2525

2626
app = Client("my_account")
2727

2828

29-
@app.on_message(Filters.private)
30-
def hello(client, message):
31-
message.reply_text("Hello {}".format(message.from_user.first_name))
29+
@app.on_message(filters.private)
30+
async def hello(client, message):
31+
await message.reply_text(f"Hello {message.from_user.mention}")
3232

3333

3434
app.run()
3535
```
3636

37-
**Pyrogram** is an elegant, easy-to-use [Telegram](https://telegram.org/) client library and framework written from the
38-
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).
39-
40-
> [Pyrogram in fully-asynchronous mode is also available »](https://github.com/pyrogram/pyrogram/issues/181)
41-
>
42-
> [Working PoC of Telegram voice calls using Pyrogram »](https://github.com/bakatrouble/pytgvoip)
37+
**Pyrogram** is a modern, elegant and easy-to-use [Telegram](https://telegram.org/) framework written from the ground up
38+
in Python and C. It enables you to easily create custom apps for both user and bot identities (bot API alternative) via
39+
the [MTProto API](https://core.telegram.org/api#telegram-api).
4340

4441
### Features
4542

4643
- **Easy**: You can install Pyrogram with pip and start building your applications right away.
4744
- **Elegant**: Low-level details are abstracted and re-presented in a much nicer and easier way.
4845
- **Fast**: Crypto parts are boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance library
4946
written in pure C.
50-
- **Documented**: Pyrogram API methods, types and public interfaces are well documented.
51-
- **Type-hinted**: Exposed Pyrogram types and method parameters are all type-hinted.
47+
- **Asynchronous**: Allows both synchronous and asynchronous usages to fit all usage needs.
48+
- **Documented**: API methods, types and public interfaces are all [well documented](https://docs.pyrogram.org).
49+
- **Type-hinted**: Types and methods are all type-hinted, enabling excellent editor support.
5250
- **Updated**, to make use of the latest Telegram API version and features.
5351
- **Bot API-like**: Similar to the Bot API in its simplicity, but much more powerful and detailed.
5452
- **Pluggable**: The Smart Plugin system allows to write components with minimal boilerplate code.
5553
- **Comprehensive**: Execute any advanced action an official client is able to do, and even more.
5654

5755
### Requirements
5856

59-
- Python 3.5.3 or higher.
57+
- Python 3.6 or higher.
6058
- A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
6159

6260
### Installing
@@ -67,17 +65,9 @@ pip3 install pyrogram
6765

6866
### Resources
6967

70-
- The Docs contain lots of resources to help you getting started with Pyrogram: https://docs.pyrogram.org.
71-
- Reading [Examples in this repository](https://github.com/pyrogram/pyrogram/tree/master/examples) is also a good way
72-
for learning how Pyrogram works.
73-
- Seeking extra help? Don't be shy, come join and ask our [Community](https://t.me/PyrogramChat)!
74-
- For other requests you can send an [Email](mailto:dan@pyrogram.org) or a [Message](https://t.me/haskell).
75-
76-
### Contributing
77-
78-
Pyrogram is brand new, and **you are welcome to try it and help make it even better** by either submitting pull
79-
requests or reporting issues/bugs as well as suggesting best practices, ideas, enhancements on both code
80-
and documentation. Any help is appreciated!
68+
- The docs contain lots of resources to help you get started with Pyrogram: https://docs.pyrogram.org.
69+
- Seeking extra help? Come join and ask our community: https://t.me/pyrogram.
70+
- For other kind of inquiries, you can send a [message](https://t.me/haskell) or an [e-mail](mailto:dan@pyrogram.org).
8171

8272
### Copyright & License
8373

0 commit comments

Comments
 (0)