Tg API
Библиотека Tg API упрощает работу с веб-API Telegram. Она предоставляет тонкую обёртку над веб API Telegram и библиотекой HTTPX. Библиотека Tg API добавляет к обычным возможностям HTTPX свои схемы данных и удобные часто используемые функции, но не мешает, при необходимости, спускаться ниже на уровень HTTP-запросов.
Пример отправки пользователю текстового сообщения:
from tg_api import SyncTgClient, SendMessageRequest
with SyncTgClient.setup(token):
tg_request = SendMessageRequest(chat_id=tg_chat_id, text='Message proofs high level usage.')
tg_request.send()
Ключевые возможности библиотеки
Ключевые возможности библиотеки Tg API:
- Поддержка синхронных и асинхронных запросов к API
- Shortcuts для часто используемых запросов
- Лёгкий доступ к боту из любого места в коде
- Наглядные схемы данных для всех типов запросов и ответов API
- Аннотация типов для удобства работы с IDE
- Простое низкоуровневое API для кастомизации запросов к API
- Набор инструментов для удобной работы с исключениями
Как установить
Библиотека доступна на PyPI:
$ python -m pip install tg-api
Поддерживаемые версии Python и зависимостей
Поддерживаются:
Документация
Документация доступна на Read the Docs: https://tg-api.readthedocs.io/en/latest/.
Разработчикам библиотеки Tg API
Инструкции и справочная информация для разработчиков библиотеки Tg API собраны в отдельном документе CONTRIBUTING.md.
Metadata
Release files for tg-api 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tg_api-1.5.0.tar.gz | 27.0 kB | Without provenance | Details for tg_api-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tg_api-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for tg_api-1.5.0-py3-none-any.whl |
Total release size: 54.1 kB
Release files / tg_api-1.5.0.tar.gz
| Download URL | tg_api-1.5.0.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d2390e9e56e72a513ff8a1052fe8146de76a05164f992a0ff69f777d0774b91
|
|
BLAKE2b-256 checksum How to use checksums |
c2cbf278719f0d685b29175913dd424dcdefbe07868a2d141e466dfdd1b12374
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / tg_api-1.5.0-py3-none-any.whl
| Download URL | tg_api-1.5.0-py3-none-any.whl |
|---|---|
| Size | 27.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6140f95f0227d9fe8497b55d3dcd653bba67f4e3590fc29a7bafaed87a1f942
|
|
BLAKE2b-256 checksum How to use checksums |
1aea0e19736f1e4a75e1ceaa0ecd923b362a74dc98a358024950b60695cccb51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for tg-api 1.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.