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.3.tar.gz
(218.6 kB
view details)
Built Distribution
File details
Details for the file telegram_pydantic-0.181.3.tar.gz
.
File metadata
- Download URL: telegram_pydantic-0.181.3.tar.gz
- Upload date:
- Size: 218.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1d068c273b8f84c23d85976cc4c09a6ba8cbd99ebe8418ff6e9f30ad7a2c167 |
|
MD5 | 6f33ac0872b1f1bffb924ec1921e50b1 |
|
BLAKE2b-256 | 8c9d2dc18872dd33472929c8da0d09cce38a9276f06c1bd51371a6628c6fc897 |
File details
Details for the file telegram_pydantic-0.181.3-py3-none-any.whl
.
File metadata
- Download URL: telegram_pydantic-0.181.3-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 | 6401fadde5b698bb098bf3e00f164d6d393776ebc5f4d82f145c4bfff26cbda4 |
|
MD5 | 32c5ef69e7cd4b8f19c9278b691fa469 |
|
BLAKE2b-256 | 9d0ee34d850262fa5b3023068dc360b78f1d5b8e9ec301514bd47c8169dd2e6c |