Skip to main content

easy and fast processing of telegram stickers

Project description

📦 Telegram Sticker Utils SDK

PyPI version Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_sticker_utils-0.2.14.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

telegram_sticker_utils-0.2.14-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file telegram_sticker_utils-0.2.14.tar.gz.

File metadata

  • Download URL: telegram_sticker_utils-0.2.14.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for telegram_sticker_utils-0.2.14.tar.gz
Algorithm Hash digest
SHA256 b115c1b7153aa9d0f7de74990ddc1972c28b062d7b9ba8437caf9b90d7282733
MD5 1ce4049ec7a6679858baa58a1b0805ee
BLAKE2b-256 a859f65e0c682577caeb98ab21705fda1bdf595a92a5a4178357c8f5e434a9e6

See more details on using hashes here.

Provenance

File details

Details for the file telegram_sticker_utils-0.2.14-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_sticker_utils-0.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 cc3553323a7b2f05ba39794fbd31d721e78c39eec88bef384dc7c54ed3ddb34e
MD5 b0f80337fddd0c084d0b4b8ec034027d
BLAKE2b-256 4bae1578441f35724218e0725bfcdd72efaa443d53583dc5eb1927a5f778a1ae

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page