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,
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
File details
Details for the file telegram_sticker_utils-0.2.5.tar.gz
.
File metadata
- Download URL: telegram_sticker_utils-0.2.5.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.17.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd8035a9c01af5c7e297a30ff11308dd90011c63d2c8729e98bd236804a5bac5 |
|
MD5 | 9a9f9edffa652b4ed6f1c860ce45652a |
|
BLAKE2b-256 | 97e9ed4b715a3a7ce6dafb8b7591a3db29a516aecf6672a6fbd09cbfca85df47 |
Provenance
File details
Details for the file telegram_sticker_utils-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: telegram_sticker_utils-0.2.5-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.17.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c711890a2a5e9877f6b05754c30c7612b1b6397890a0609afaba04a72c4dd65 |
|
MD5 | 9ae9d98ce0462cb451973ad6e4920f94 |
|
BLAKE2b-256 | 8c281252f953c5fdc0001cb7ce2fadd8fbfcc9d6ef2ca9ef94a68ce96011eecb |