easy and fast processing of telegram stickers
Project description
📦 Telegram Sticker Utils SDK
If you are not a developer, you can use the Telegram Sticker CLI (developed by this SDK) for user-friendly operations.
This SDK provides a set of utilities for working with Telegram stickers.
- Convert image formats without losing transparency.
- Auto optimize output size for sticker, make it valid for Telegram.
- Auto-detect sticker type and emojis.
🛠 Supported Pack Types
- Video Sticker
- Static Sticker
- Animated Sticker(Tgs)
🚀 Installation
You need install ImageMagick before using this SDK.
Install Guide: https://docs.wand-py.org/en/0.6.12/guide/install.html
pip3 install telegram-sticker-utils
📖 Usage
from telegram_sticker_utils import ImageProcessor
from telegram_sticker_utils import is_animated_gif
print(is_animated_gif('test.gif')) # Path to the image file or a file-like object.
for sticker_file in ["happy.webp", "sad.png", "高兴.jpg", "悲伤.gif"]:
sticker = ImageProcessor.make_sticker(
input_name=sticker_file,
input_data=open(sticker_file, 'rb').read(),
scale=512,
master_edge='width',
)
print(sticker.sticker_type)
print(sticker.emojis)
with open(f"{sticker_file}.{sticker.file_extension}", 'wb') as f:
f.write(sticker.data)
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
Built Distribution
Close
Hashes for telegram_sticker_utils-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66507e22206532097d309ca466c7dd976bdc43dce83261dad5c61e2a48c4e68f |
|
MD5 | 15a0e3db60d4756cb9022bfc28fe7f9e |
|
BLAKE2b-256 | 15d766e764c1e60d5ebcd3a48a5fe5b3918fc17d9699c46b12f782afe07ae7ec |
Close
Hashes for telegram_sticker_utils-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0867b66abb6e9809662e3d1c8f94bc17e874f7bcf4801b72499736cdaabe0a6 |
|
MD5 | b6380684f479f2fb89004d836528bd72 |
|
BLAKE2b-256 | 8138675f2b381b7dc3afaf80e221a2c2723779cbb436ea2e5172c1ebf0b359c4 |