zafather 0.4.1__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.
Files changed (37) hide show
  1. zafather-0.4.1/CHANGELOG.md +55 -0
  2. zafather-0.4.1/CONTRIBUTING.md +49 -0
  3. zafather-0.4.1/LICENSE +21 -0
  4. zafather-0.4.1/MANIFEST.in +8 -0
  5. zafather-0.4.1/PKG-INFO +591 -0
  6. zafather-0.4.1/README.md +558 -0
  7. zafather-0.4.1/examples/api102_bot.py +151 -0
  8. zafather-0.4.1/examples/echo_bot.py +20 -0
  9. zafather-0.4.1/examples/full_bot.py +137 -0
  10. zafather-0.4.1/examples/miniapp/bot.py +110 -0
  11. zafather-0.4.1/examples/miniapp/webapp/index.html +300 -0
  12. zafather-0.4.1/examples/rich_bot.py +90 -0
  13. zafather-0.4.1/pyproject.toml +49 -0
  14. zafather-0.4.1/setup.cfg +4 -0
  15. zafather-0.4.1/zafather/__init__.py +145 -0
  16. zafather-0.4.1/zafather/__main__.py +76 -0
  17. zafather-0.4.1/zafather/app.py +284 -0
  18. zafather-0.4.1/zafather/bot.py +231 -0
  19. zafather-0.4.1/zafather/enums.py +165 -0
  20. zafather-0.4.1/zafather/filters.py +292 -0
  21. zafather-0.4.1/zafather/fsm.py +193 -0
  22. zafather-0.4.1/zafather/keyboards.py +364 -0
  23. zafather-0.4.1/zafather/magic.py +146 -0
  24. zafather-0.4.1/zafather/managed.py +198 -0
  25. zafather-0.4.1/zafather/py.typed +0 -0
  26. zafather-0.4.1/zafather/rich.py +344 -0
  27. zafather-0.4.1/zafather/router.py +248 -0
  28. zafather-0.4.1/zafather/text.py +223 -0
  29. zafather-0.4.1/zafather/types.py +415 -0
  30. zafather-0.4.1/zafather/webapp.py +410 -0
  31. zafather-0.4.1/zafather/webserver.py +225 -0
  32. zafather-0.4.1/zafather.egg-info/PKG-INFO +591 -0
  33. zafather-0.4.1/zafather.egg-info/SOURCES.txt +35 -0
  34. zafather-0.4.1/zafather.egg-info/dependency_links.txt +1 -0
  35. zafather-0.4.1/zafather.egg-info/entry_points.txt +2 -0
  36. zafather-0.4.1/zafather.egg-info/requires.txt +4 -0
  37. zafather-0.4.1/zafather.egg-info/top_level.txt +1 -0
@@ -0,0 +1,55 @@
1
+ # O'zgarishlar tarixi
2
+
3
+ Format: [Keep a Changelog](https://keepachangelog.com/), versiyalash: [SemVer](https://semver.org/).
4
+
5
+ ## [0.4.1]
6
+ ### Qo'shildi
7
+ - **PyPI nashri**: `pyproject.toml` to'ldirildi (classifiers, urls, authors),
8
+ `py.typed` (PEP 561), `MANIFEST.in`.
9
+ - GitHub Actions: `ci.yml` (3.9–3.13 da testlar), `publish.yml` (tag qo'yilganda
10
+ PyPI Trusted Publishing orqali avtomatik nashr).
11
+ - `CONTRIBUTING.md` — loyiha ochiq, PR va takliflar qabul qilinadi.
12
+ - README: muallif (**ismoilov299**), hissa qo'shish va muhokama bo'limlari,
13
+ PyPI/Python/litsenziya badge'lari, "Buy Me A Coffee" qo'llab-quvvatlash.
14
+ - `.github/FUNDING.yml` — GitHub Sponsor tugmasi.
15
+
16
+ ### O'zgardi
17
+ - `CLAUDE.md` git kuzatuvidan chiqarildi (lokal ishlab chiqish fayli);
18
+ hissa qo'shish qo'llanmasi to'liq `CONTRIBUTING.md` da.
19
+ - `__author__`, `__license__` `zafather/__init__.py` da.
20
+
21
+ ## [0.4.0]
22
+ ### Qo'shildi
23
+ - **Rich Messages** (Bot API 10.1/10.2): `RichMessage` HTML quruvchisi
24
+ (sarlavha, ro'yxat, checklist, jadval, kod, yig'iladigan bo'lim, thinking),
25
+ `RichStream` — AI javobini oqim bilan yuborish (`sendRichMessageDraft`).
26
+ - `Message.answer_rich()`, `Message.edit_rich()`, `Bot.send_rich()`, `Bot.stream_rich()`.
27
+ - `markdown_rich()` — markdown orqali rich message.
28
+ - `SafeHTML` — ikki marta ekranlashning oldini oladi.
29
+
30
+ ## [0.3.0]
31
+ ### Qo'shildi
32
+ - **Mini App**: `validate()` (HMAC-SHA256), `validate_third_party()` (Ed25519),
33
+ `parse_init_data()`, `direct_link()`, `main_app_link()`, `attach_link()`.
34
+ - `MiniAppServer` — static fayllar + avtomatik tekshiriladigan JSON API + webhook.
35
+ - `MiniApp` — menyu tugmasi, `answerWebAppQuery`, tayyor xabar/tugmalar, emoji status.
36
+ - `WebAppData` filtri; `examples/miniapp/` to'liq namunasi.
37
+
38
+ ## [0.2.0]
39
+ ### Qo'shildi
40
+ - Bot API 10.2 darajasi: 26 ta update turi, `allowed_updates` avtomatik to'liq.
41
+ - **Rangli tugmalar** (9.4+): `.primary()`, `.success()`, `.danger()`, `icon=`.
42
+ - **Premium emoji**: `emoji()`, `TextBuilder` (entity orqali, `date_time` bilan).
43
+ - **Managed bots** (9.6+): `ManagedBots`, `BotFarm`, `Zafather.spawn()`.
44
+ - Ephemeral xabarlar, reaksiyalar (`m.react()`), guest mode, obunalar.
45
+ - Yangi dekoratorlar: `@bot.managed_bot`, `@bot.guest`, `@bot.subscription`,
46
+ `@bot.reaction`, `@bot.business_message`, `@bot.boost`, `@bot.service`.
47
+ - Yangi filtrlar: `Service`, `Ephemeral`, `Premium`, `HasCustomEmoji`.
48
+
49
+ ## [0.1.0]
50
+ ### Qo'shildi
51
+ - Yadro: `Zafather` (polling, dispatch, hooks, webhook), `Bot` (dinamik API
52
+ metodlari, retry, 429, fayl yuklash), `Router` (middleware, sub-router).
53
+ - Filtrlar: `Command`, `Text`, `Regex`, `ChatType`, `ContentType`, `UserFilter`.
54
+ - `F` sehrli filtri, FSM (`StatesGroup`, `FSMContext`, Memory/JSON storage).
55
+ - Klaviaturalar, CLI (`python -m zafather new`), 3 ta namuna.
@@ -0,0 +1,49 @@
1
+ # Zafather'ga hissa qo'shish
2
+
3
+ Loyiha ochiq — **pull request va takliflar mamnuniyat bilan qabul qilinadi.**
4
+
5
+ ## Taklif yoki xatolik
6
+
7
+ [Issues](https://github.com/ismoilov299/zafather/issues) da yozing. Xatolik bo'lsa:
8
+ qanday takrorlash mumkinligini, kutilgan va haqiqiy natijani yozing.
9
+
10
+ ## Kod yuborish
11
+
12
+ 1. Repozitoriyni fork qiling, `main` dan alohida branch oching
13
+ (`feat/callback-data`, `fix/regex-caption` kabi).
14
+ 2. **Har bir yangi imkoniyat uchun test majburiy** — `test_zafather.py`,
15
+ `test_miniapp.py`, `test_rich.py` uslubida (Telegram'ga ulanmasdan,
16
+ `app.bot.request` / `app.bot.call` soxta funksiya bilan almashtiriladi).
17
+ 3. Tekshiring:
18
+ ```bash
19
+ python -m compileall -q zafather
20
+ python test_zafather.py
21
+ python test_miniapp.py
22
+ python test_rich.py
23
+ ```
24
+ Testlar soni kamaymasin.
25
+ 4. Yangi modul qo'shsangiz: `zafather/__init__.py` ga eksport + `__all__` ga
26
+ nom + `README.md` da bo'lim + `CHANGELOG.md` ga qator + versiya ko'tarish
27
+ (`pyproject.toml` va `zafather/__init__.py` bir vaqtda).
28
+ 5. Commit xabari: `feat:`, `fix:`, `docs:`, `test:`, `refactor:` + o'zbekcha
29
+ tavsif. Har bir imkoniyat alohida commit.
30
+ 6. `main` ga pull request oching.
31
+
32
+ ## Kod uslubi
33
+
34
+ - Izohlar va docstring'lar — **o'zbekcha**, kod nomlari — inglizcha.
35
+ - Public API uchun type hint majburiy.
36
+ - Kutubxona kodida `print()` yo'q — `logging.getLogger("zafather.<modul>")`.
37
+ - Satr uzunligi ~100 belgi.
38
+ - Yangi majburiy bog'liqlik qo'shilmaydi (`aiohttp` dan boshqa;
39
+ `cryptography` — ixtiyoriy).
40
+ - Bot API maydon nomlarini taxmin qilib kodga qotirmang — noaniq bo'lsa
41
+ `**params` orqali o'tkazing va docstring'da belgilang.
42
+ - `Bot.__getattr__` snake_case→camelCase, filtr `dict` qaytarsa handlerga
43
+ argument bo'ladi, `UNSET` sentinel `state=None` dan farqlanadi — mavjud
44
+ namunalarga qarab yozing.
45
+
46
+ ## Muhokama
47
+
48
+ Savol yoki g'oya uchun: [regnad299@gmail.com](mailto:regnad299@gmail.com)
49
+ yoki Issues'da `question` yorlig'i bilan.
zafather-0.4.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ismoilov299
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ include zafather/py.typed
6
+ recursive-include examples *.py *.html
7
+ exclude zafather.bundle
8
+ global-exclude __pycache__ *.py[cod]