Set of telegram pydantic models
Project description
telegram_pydantic - Set of Pydantic models, generated according to Telegram TL Scheme
Layer 181
Example
from pydantic import TypeAdapter
from telegram_pydantic import base
from telegram_pydantic import types
ta = TypeAdapter(base.Message) # Base Constructor
json_data = {
"_": "types.Message",
"id": 1,
"peer_id": {"_": "types.PeerUser", "user_id": 1},
"date": 1720715931,
"message": "Hello, World!",
"out": False,
"mentioned": False,
"media_unread": False,
"silent": False,
"post": False,
"from_scheduled": False,
"legacy": False,
"edit_hide": False,
"pinned": False,
"noforwards": False,
"invert_media": False,
"offline": False,
"saved_peer_id": {"_": "types.PeerUser", "user_id": 1},
"entities": [],
"restriction_reason": []
}
message = ta.validate_python(json_data)
print(isinstance(message, types.Message)) # True
LICENSE
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
telegram_pydantic-0.181.2.tar.gz
(218.5 kB
view details)
Built Distribution
File details
Details for the file telegram_pydantic-0.181.2.tar.gz
.
File metadata
- Download URL: telegram_pydantic-0.181.2.tar.gz
- Upload date:
- Size: 218.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a40932625e6d07206b7294a2f0e2395d82b1c02caa4553d7be7ceb321cc4eb95 |
|
MD5 | 72af342287993f10bd9187c4f4446208 |
|
BLAKE2b-256 | f22982c28693b5238709a5a2d3a9fdd8ee2c2a3dfd4a4d4362060f32f206e2fc |
File details
Details for the file telegram_pydantic-0.181.2-py3-none-any.whl
.
File metadata
- Download URL: telegram_pydantic-0.181.2-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d75cd7f9da6ccb718974c3492873032554dcd948616b203b8525d7b0ddb05d8 |
|
MD5 | a636c559658bb0159b3c88e5dfa0e6d8 |
|
BLAKE2b-256 | 0332d37d71aac2ca705603377cdec0da527441080ec5b38441c44bec4192327f |