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.5.tar.gz
(220.7 kB
view details)
Built Distribution
File details
Details for the file telegram_pydantic-0.181.5.tar.gz
.
File metadata
- Download URL: telegram_pydantic-0.181.5.tar.gz
- Upload date:
- Size: 220.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af774408299213da11381931ed3fa7e90127210c2efedd096f369c4ee74341d5 |
|
MD5 | 7ab8d6e86f7cc7553d33338c824e7311 |
|
BLAKE2b-256 | 95c7fdbe4c8c22926f83c3d4977aaad0dfc99bfdfe18b2afd6398c9de30a9cf3 |
File details
Details for the file telegram_pydantic-0.181.5-py3-none-any.whl
.
File metadata
- Download URL: telegram_pydantic-0.181.5-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 | 819a0bb41e41336c7d8c58c24f227ce66af54c4480f29cd7e0857f24c6358ad3 |
|
MD5 | cb730d34e50f2cbe3d158531bc01bd89 |
|
BLAKE2b-256 | 540181c5c9b37621664a5156088cfb303f22b54dcfed63dd8b98b5c912efa99c |