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 and ffmpeg before using this SDK.
Install Guide: https://docs.wand-py.org/en/0.6.12/guide/install.html
apt install ffmpeg
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
)
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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5be084742d29978aa13aaa0c01dc28effee52b3dd8f9bfc60ce04a4cb0676cb4 |
|
MD5 | 4ad32d5131f4611d82bc3a53bd8f2b42 |
|
BLAKE2b-256 | ad97da571e11c98b09c82d09b90d127ff414435d498b022fd7d6e8204566c8cd |
Close
Hashes for telegram_sticker_utils-0.2.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcb67e8e1056ff196dc07597f5c95a48ea0992f06d3962b8a85328616b1e6abb |
|
MD5 | 82a5536af294fc08a8214dbd07d37d0e |
|
BLAKE2b-256 | 20b0da970ede22749f71b863186792ed756935e5e36d2007cf76df37f3556d63 |