ferogram 0.4.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ferogram-0.5.0/.readthedocs.yaml +35 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/CHANGELOG.md +52 -5
- {ferogram-0.4.0 → ferogram-0.5.0}/Cargo.lock +211 -1388
- {ferogram-0.4.0 → ferogram-0.5.0}/Cargo.toml +13 -6
- ferogram-0.5.0/FEATURES.md +742 -0
- ferogram-0.5.0/Makefile +32 -0
- ferogram-0.5.0/PKG-INFO +132 -0
- ferogram-0.5.0/README.md +107 -0
- ferogram-0.5.0/assets/architecture.svg +130 -0
- ferogram-0.5.0/build.rs +50 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/admin_tools.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/command_bot.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/echo_bot.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/group_management.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/media_bot.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/raw_invoke.py +6 -5
- ferogram-0.5.0/examples/rich_message.py +193 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/search_bot.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/send_hi.py +6 -5
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/send_media.py +8 -5
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/send_message.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/update_handlers.py +6 -5
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/user_management.py +6 -5
- {ferogram-0.4.0 → ferogram-0.5.0}/examples/userbot.py +7 -5
- ferogram-0.5.0/ferogram/__init__.py +83 -0
- ferogram-0.4.0/ferogram/raw_api.tl → ferogram-0.5.0/ferogram/api.tl +126 -31
- ferogram-0.5.0/ferogram/client.py +2878 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/filters.py +41 -30
- ferogram-0.5.0/ferogram/keyboards.py +230 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/logging.py +7 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/__init__.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/api/__init__.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/api/functions.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/api/types.py +5 -4
- ferogram-0.5.0/ferogram/raw/codegen.py +693 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/__init__.py +5 -4
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/_tl_schema.py +1260 -1162
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/__init__.py +7 -6
- ferogram-0.5.0/ferogram/raw/generated/functions/account.py +4147 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/aicompose.py +283 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/auth.py +408 -31
- ferogram-0.5.0/ferogram/raw/generated/functions/bots.py +1357 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/channels.py +2145 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/chatlists.py +383 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/contacts.py +994 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/folders.py +18 -6
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/fragment.py +18 -6
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/help.py +281 -30
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/langpack.py +75 -10
- ferogram-0.5.0/ferogram/raw/generated/functions/messages.py +10909 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/payments.py +2471 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/phone.py +1769 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/photos.py +273 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/premium.py +192 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/smsjobs.py +209 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/stats.py +355 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/stickers.py +443 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/stories.py +1454 -0
- ferogram-0.5.0/ferogram/raw/generated/functions/updates.py +161 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/upload.py +126 -13
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/functions/users.py +93 -12
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/__init__.py +7 -6
- ferogram-0.5.0/ferogram/raw/generated/types/_base.py +53328 -0
- ferogram-0.5.0/ferogram/raw/generated/types/account.py +1444 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/aicompose.py +32 -7
- ferogram-0.5.0/ferogram/raw/generated/types/auth.py +1008 -0
- ferogram-0.5.0/ferogram/raw/generated/types/bots.py +227 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/channels.py +110 -13
- ferogram-0.5.0/ferogram/raw/generated/types/chatlists.py +239 -0
- ferogram-0.5.0/ferogram/raw/generated/types/contacts.py +464 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/fragment.py +31 -6
- ferogram-0.5.0/ferogram/raw/generated/types/help.py +1177 -0
- ferogram-0.5.0/ferogram/raw/generated/types/messages.py +3587 -0
- ferogram-0.5.0/ferogram/raw/generated/types/payments.py +1815 -0
- ferogram-0.5.0/ferogram/raw/generated/types/phone.py +329 -0
- ferogram-0.5.0/ferogram/raw/generated/types/photos.py +127 -0
- ferogram-0.5.0/ferogram/raw/generated/types/premium.py +196 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/smsjobs.py +45 -7
- ferogram-0.5.0/ferogram/raw/generated/types/stats.py +412 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/stickers.py +18 -6
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/storage.py +97 -15
- ferogram-0.5.0/ferogram/raw/generated/types/stories.py +503 -0
- ferogram-0.5.0/ferogram/raw/generated/types/updates.py +402 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/upload.py +86 -10
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/generated/types/users.py +73 -10
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/raw/proxy.py +50 -24
- ferogram-0.5.0/ferogram/raw/tl.py +677 -0
- ferogram-0.5.0/ferogram/rich.py +380 -0
- ferogram-0.5.0/ferogram/types.py +605 -0
- ferogram-0.5.0/ferogram/updates.py +393 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/pyproject.toml +3 -2
- ferogram-0.5.0/src/connection.rs +307 -0
- ferogram-0.5.0/src/lib.rs +35 -0
- ferogram-0.5.0/src/raw.rs +37 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/src/session.rs +3 -32
- ferogram-0.5.0/src/srp.rs +37 -0
- ferogram-0.5.0/tests/test_rich.py +354 -0
- ferogram-0.5.0/tests/test_tl_roundtrip.py +186 -0
- ferogram-0.4.0/FEATURES.md +0 -1045
- ferogram-0.4.0/PKG-INFO +0 -225
- ferogram-0.4.0/README.md +0 -200
- ferogram-0.4.0/ferogram/__init__.py +0 -63
- ferogram-0.4.0/ferogram/client.py +0 -1344
- ferogram-0.4.0/ferogram/raw/codegen.py +0 -321
- ferogram-0.4.0/ferogram/raw/generated/functions/account.py +0 -2423
- ferogram-0.4.0/ferogram/raw/generated/functions/aicompose.py +0 -173
- ferogram-0.4.0/ferogram/raw/generated/functions/bots.py +0 -817
- ferogram-0.4.0/ferogram/raw/generated/functions/channels.py +0 -1302
- ferogram-0.4.0/ferogram/raw/generated/functions/chatlists.py +0 -245
- ferogram-0.4.0/ferogram/raw/generated/functions/contacts.py +0 -600
- ferogram-0.4.0/ferogram/raw/generated/functions/messages.py +0 -6328
- ferogram-0.4.0/ferogram/raw/generated/functions/payments.py +0 -1466
- ferogram-0.4.0/ferogram/raw/generated/functions/phone.py +0 -1048
- ferogram-0.4.0/ferogram/raw/generated/functions/photos.py +0 -158
- ferogram-0.4.0/ferogram/raw/generated/functions/premium.py +0 -121
- ferogram-0.4.0/ferogram/raw/generated/functions/smsjobs.py +0 -133
- ferogram-0.4.0/ferogram/raw/generated/functions/stats.py +0 -209
- ferogram-0.4.0/ferogram/raw/generated/functions/stickers.py +0 -269
- ferogram-0.4.0/ferogram/raw/generated/functions/stories.py +0 -852
- ferogram-0.4.0/ferogram/raw/generated/functions/updates.py +0 -97
- ferogram-0.4.0/ferogram/raw/generated/types/_base.py +0 -30277
- ferogram-0.4.0/ferogram/raw/generated/types/account.py +0 -825
- ferogram-0.4.0/ferogram/raw/generated/types/auth.py +0 -591
- ferogram-0.4.0/ferogram/raw/generated/types/bots.py +0 -143
- ferogram-0.4.0/ferogram/raw/generated/types/chatlists.py +0 -152
- ferogram-0.4.0/ferogram/raw/generated/types/contacts.py +0 -298
- ferogram-0.4.0/ferogram/raw/generated/types/help.py +0 -702
- ferogram-0.4.0/ferogram/raw/generated/types/messages.py +0 -2116
- ferogram-0.4.0/ferogram/raw/generated/types/payments.py +0 -1039
- ferogram-0.4.0/ferogram/raw/generated/types/phone.py +0 -212
- ferogram-0.4.0/ferogram/raw/generated/types/photos.py +0 -86
- ferogram-0.4.0/ferogram/raw/generated/types/premium.py +0 -116
- ferogram-0.4.0/ferogram/raw/generated/types/stats.py +0 -257
- ferogram-0.4.0/ferogram/raw/generated/types/stories.py +0 -304
- ferogram-0.4.0/ferogram/raw/generated/types/updates.py +0 -248
- ferogram-0.4.0/ferogram/raw/tl.py +0 -275
- ferogram-0.4.0/ferogram/types.py +0 -154
- ferogram-0.4.0/src/auth.rs +0 -227
- ferogram-0.4.0/src/client.rs +0 -4030
- ferogram-0.4.0/src/keyboards.rs +0 -567
- ferogram-0.4.0/src/lib.rs +0 -86
- ferogram-0.4.0/src/message.rs +0 -532
- ferogram-0.4.0/src/raw.rs +0 -51
- ferogram-0.4.0/src/types.rs +0 -576
- ferogram-0.4.0/src/updates.rs +0 -597
- {ferogram-0.4.0 → ferogram-0.5.0}/.github/workflows/compile-check.yml +0 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/.github/workflows/publish.yml +0 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/.gitignore +0 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/LICENSE-APACHE +0 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/LICENSE-MIT +0 -0
- {ferogram-0.4.0 → ferogram-0.5.0}/ferogram/py.typed +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Read the Docs configuration file for Sphinx projects
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
# Set the OS, Python version and other tools you might need
|
|
8
|
+
build:
|
|
9
|
+
os: ubuntu-24.04
|
|
10
|
+
tools:
|
|
11
|
+
python: "3.12"
|
|
12
|
+
# You can also specify other tool versions:
|
|
13
|
+
# nodejs: "20"
|
|
14
|
+
# rust: "1.70"
|
|
15
|
+
# golang: "1.20"
|
|
16
|
+
|
|
17
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
18
|
+
sphinx:
|
|
19
|
+
configuration: docs/conf.py
|
|
20
|
+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
|
|
21
|
+
# builder: "dirhtml"
|
|
22
|
+
# Fail on all warnings to avoid broken references
|
|
23
|
+
# fail_on_warning: true
|
|
24
|
+
|
|
25
|
+
# Optionally build your docs in additional formats such as PDF and ePub
|
|
26
|
+
# formats:
|
|
27
|
+
# - pdf
|
|
28
|
+
# - epub
|
|
29
|
+
|
|
30
|
+
# Optional but recommended, declare the Python requirements required
|
|
31
|
+
# to build your documentation
|
|
32
|
+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
33
|
+
# python:
|
|
34
|
+
# install:
|
|
35
|
+
# - requirements: docs/requirements.txt
|
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
## 0.5.0 (2026-06-28)
|
|
2
|
+
|
|
3
|
+
### Architecture
|
|
4
|
+
|
|
5
|
+
The Rust dependency has changed from the monolithic `ferogram` crate to five focused crates from the ferogram core:
|
|
6
|
+
|
|
7
|
+
- `ferogram-mtsender` - MTProto sender, message framing, and acknowledgement
|
|
8
|
+
- `ferogram-session` - session storage (file, sqlite, libsql, memory, string)
|
|
9
|
+
- `ferogram-connect` - TCP/TLS transport and DC routing
|
|
10
|
+
- `ferogram-tl-types` - generated TL type definitions
|
|
11
|
+
- `ferogram-crypto` - AES-IGE, Diffie-Hellman, and SHA helpers
|
|
12
|
+
|
|
13
|
+
These five crates form the battle-tested lower layer of ferogram. They change rarely and are stable across minor versions. All high-level logic (message parsing, update dispatch, peer resolution, serialization, deserialization) now lives in Python. This split means the compiled extension is smaller and faster to build, and Python-side behaviour can be updated without recompiling the Rust extension.
|
|
14
|
+
|
|
15
|
+
The compiled extension now uses `abi3-py39` (was `abi3-py313`), so a single wheel runs on Python 3.9 and later.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **`TransferHandle`** - pause, resume, and cancel any upload or download in flight. Create a `TransferHandle`, pass it to `upload_with_progress` or `download_with_progress`, then call `.pause()`, `.resume()`, or `.cancel()` from any coroutine. `.progress()` returns a dict with `done`, `total`, `elapsed_ms`, `percent`, `speed_bps`, `eta_secs`, `speed_human`, and `bytes_human`.
|
|
20
|
+
- **`TransferCancelled` exception** - raised when a `TransferHandle` is cancelled mid-transfer.
|
|
21
|
+
- **`keyboards` module** - `InlineKeyboard`, `InlineButton`, `ReplyKeyboard`, `ReplyButton`, `RemoveKeyboard`, and `ForceReply` are now pure Python and importable from `ferogram` directly.
|
|
22
|
+
- **`types` module** - all entity types (`User`, `Message`, `Chat`, `Dialog`, `ChatMember`, `UserFull`, `Authorization`, `ForumTopic`, `BotInfo`, `InviteLinkMember`, `ReadParticipant`, `AdminLogEvent`, `StickerSetInfo`, `BroadcastStats`, `MegagroupStats`, `NotifySettings`) moved from Rust to Python dataclasses. The public API is identical.
|
|
23
|
+
- **`updates` module** - update wrapper types (`NewMessage`, `EditedMessage`, `MessageDeletion`, `CallbackQuery`, `InlineQuery`, `InlineSend`, `UserStatus`, `ParticipantUpdate`, `JoinRequest`, `MessageReaction`, `PollVote`, `BotStopped`, `ShippingQuery`, `PreCheckoutQuery`, `ChatBoost`, `RawUpdate`) moved from Rust to Python dataclasses.
|
|
24
|
+
- **`rich` module** - `send_rich_message`, `edit_rich_message`, `send_rich_message_draft`, and `get_rich_message` via a `_RichMixin`. Supports Telegram rich text blocks including headers, tables, collages, task lists, footnotes, math, time stamps, and custom emoji via Markdown or HTML input.
|
|
25
|
+
- **Automatic TL codegen at build time** - `build.rs` now runs `ferogram/raw/codegen.py` during `maturin develop` / `pip install .`. Set `FEROGRAM_SKIP_CODEGEN=1` to skip if you only changed Rust. The codegen uses the same Python interpreter maturin selected.
|
|
26
|
+
- **`DcConnection` and `srp_calculate`** exposed from the Rust extension for use by the pure-Python `Client` class.
|
|
27
|
+
- **`LAYER` constant** exported from `ferogram.raw.generated._tl_schema` and used automatically in `invokeWithLayer` wrappers.
|
|
28
|
+
- **`all_updates` filter** - replaces the old `all` filter (which shadowed the built-in).
|
|
29
|
+
- **`filters` improvements** - all filters now unwrap `NewMessage` / `EditedMessage` wrapper objects before inspecting the inner `Message`. Previously filters broke when the dispatcher passed wrapper objects instead of bare messages.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- `Message`, `User`, `Chat`, and all entity types are now Python dataclasses instead of PyO3 structs. They serialize to / from the TL dict representation in Python. No change to the public API.
|
|
34
|
+
- `CallbackQuery`, `InlineQuery`, and all update types are now Python dataclasses.
|
|
35
|
+
- `InlineKeyboard`, `ReplyKeyboard`, and related keyboard builders are now pure Python (`ferogram/keyboards.py`). Previously they were Rust structs.
|
|
36
|
+
- Filters rewritten to correctly unwrap update wrapper objects. `reply` filter now checks `reply_to_msg_id`; `forwarded` checks `forward_from_id`; `media` checks the `media` field directly.
|
|
37
|
+
- `codegen.py` doubled in size (321 to 691 lines): now generates specialized `to_bytes()` methods using `struct.pack` inline and a CID-dispatch `from_bytes()` router, producing faster serialization and deserialization than the previous schema-dict approach.
|
|
38
|
+
- `ferogram-py` version bump to 0.5.0. Core crates pinned to `ferogram-*` 0.6.3.
|
|
39
|
+
|
|
40
|
+
### Removed
|
|
41
|
+
|
|
42
|
+
- Direct dependency on the monolithic `ferogram` crate. The five focused crates replace it.
|
|
43
|
+
- `hex` crate dependency (was `0.4`, now unused).
|
|
44
|
+
- `all` filter removed and replaced with `all_updates` to avoid shadowing Python's built-in `all`.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## 0.4.1 (2026-06-03)
|
|
48
|
+
|
|
49
|
+
Patch release. No API changes. Identical to 0.4.0 except for dependency pins and minor internal fixes.
|
|
50
|
+
|
|
51
|
+
|
|
1
52
|
## 0.4.0 (2026-06-01)
|
|
2
53
|
|
|
3
54
|
### Added
|
|
@@ -20,7 +71,7 @@
|
|
|
20
71
|
- **`flood_sleep_threshold` kwarg on `Client`** - maps to the `AutoSleep` retry policy in the Rust core. Flood waits under this value are slept through automatically; waits above it are raised as exceptions.
|
|
21
72
|
- **`download_with_progress(peer, msg_id, path, on_progress)`** - download media with a progress callback `on_progress(done, total)`.
|
|
22
73
|
- **`upload_with_progress(path, on_progress)`** - upload a file with a progress callback. Returns a handle string accepted by `send_file`.
|
|
23
|
-
-
|
|
74
|
+
- **ferogram 0.6.0 as core dependency** - includes `Client.channel_kind_of(channel_id)` which backs the new `Message` methods above.
|
|
24
75
|
|
|
25
76
|
### Changed
|
|
26
77
|
|
|
@@ -62,9 +113,6 @@ the votes graph as a JSON string. The old `get_poll_results(peer, msg_id, poll_h
|
|
|
62
113
|
is kept for backward compat but is deprecated; the `poll_hash` parameter is ignored
|
|
63
114
|
because ferogram 0.5.0 dropped the underlying API call it relied on.
|
|
64
115
|
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
# Changelog
|
|
68
116
|
|
|
69
117
|
## 0.2.3 (2026-05-14)
|
|
70
118
|
|
|
@@ -124,7 +172,6 @@ Ten new methods for managing group and channel members.
|
|
|
124
172
|
|
|
125
173
|
`get_poll_results(peer, msg_id, poll_hash)` was in Rust but had no Python wrapper. Now exposed. Fetches and caches the latest poll results from Telegram.
|
|
126
174
|
|
|
127
|
-
---
|
|
128
175
|
|
|
129
176
|
## 0.2.2
|
|
130
177
|
|