Skip to main content

📦 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

import emoji

from telegram_sticker_utils import ImageProcessor
from telegram_sticker_utils import is_animated_gif
from telegram_sticker_utils.core.const import add_emoji_rule

try:
    add_emoji_rule("sad", "😢")
    add_emoji_rule("happy", emoji.emojize(":smile:"))
except ValueError as e:
    print("NOT emoji")

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)

Metadata

Release files for telegram-sticker-utils 0.2.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for telegram-sticker-utils 0.2.25
File Size Uploaded
telegram_sticker_utils-0.2.25.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for telegram-sticker-utils 0.2.25
File Interpreter ABI Platform
telegram_sticker_utils-0.2.25-py3-none-any.whl Python 3 none any Details

Total release size: 47.5 kB

Release files / telegram_sticker_utils-0.2.25.tar.gz

Download URL telegram_sticker_utils-0.2.25.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
600afb6ec9d41ce2a91ac90e8eb896422c56ea5d2ad689143871bb3018bb6ddc
BLAKE2b-256 checksum
How to use checksums
8e4e3fd3d96bc0d0483158a2d1911d7dfcb9ce144b7a22009712b16f59529c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.29.0 CPython/3.12.3 Linux/6.17.0-1022-azure

Release files / telegram_sticker_utils-0.2.25-py3-none-any.whl

Download URL telegram_sticker_utils-0.2.25-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad607d1bdae16decc20c2c0f14144083ad65ee75f798902b99c0c156ac8623a9
BLAKE2b-256 checksum
How to use checksums
9f63bd942756007b7e322090fbd60b60f2129e66cb1ab7c2fe1843380b56a9a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.29.0 CPython/3.12.3 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

This release

0.2.25 This release

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page