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 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


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.2.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

telegram_sticker_utils-0.2.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telegram_sticker_utils-0.2.2.tar.gz
  • Upload date:
  • Size: 13.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

Hashes for telegram_sticker_utils-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6bd0536d7dc9983797d79817cfed33c9430828fccbfb6de5babf370ca535f4c4
MD5 3f15ab38ba5867a39dbf2a3033059717
BLAKE2b-256 fc03b385bd5ec1105251ba7009dbcc22869f73ec666465756ea37a5c19ac1dba

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for telegram_sticker_utils-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea80bf226d96494345e9c540fd0c8e103847afaf457e5efa0c44d81b36873525
MD5 c8737f004e76aaaef7545bab14919310
BLAKE2b-256 b649717637f6f15073e4583314280b852db471bce83f311af14a49243c6289bb

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