{"id":16566868,"url":"https://github.com/sudoskys/telegram-sticker-utils","last_synced_at":"2025-04-10T19:50:46.500Z","repository":{"id":229480153,"uuid":"776821175","full_name":"sudoskys/telegram-sticker-utils","owner":"sudoskys","description":"📦 Telegram Sticker Maker Utils | Quickly* process an image into a format acceptable to Telegram","archived":false,"fork":false,"pushed_at":"2024-03-24T16:52:02.000Z","size":2314,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-13T11:19:18.953Z","etag":null,"topics":["telegram","telegram-sticker"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudoskys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-24T14:44:12.000Z","updated_at":"2024-08-18T14:20:37.555Z","dependencies_parsed_at":null,"dependency_job_id":"aaeb5939-f613-49b5-b1f4-87ce7286c85e","html_url":"https://github.com/sudoskys/telegram-sticker-utils","commit_stats":null,"previous_names":["sudoskys/telegram-sticker-utils"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2Ftelegram-sticker-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2Ftelegram-sticker-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2Ftelegram-sticker-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2Ftelegram-sticker-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudoskys","download_url":"https://codeload.github.com/sudoskys/telegram-sticker-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248283110,"owners_count":21077775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["telegram","telegram-sticker"],"created_at":"2024-10-11T21:01:50.762Z","updated_at":"2025-04-10T19:50:46.470Z","avatar_url":"https://github.com/sudoskys.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# 📦 Telegram Sticker Utils SDK\n\n[![PyPI version](https://badge.fury.io/py/telegram-sticker-utils.svg)](https://badge.fury.io/py/telegram-sticker-utils)\n[![Downloads](https://pepy.tech/badge/telegram-sticker-utils)](https://pepy.tech/project/telegram-sticker-utils)\n\nIf you are not a developer, you can use the Telegram Sticker [CLI](https://github.com/sudoskys/tsticker) (developed by\nthis SDK) for\nuser-friendly operations.\n\nThis SDK provides a set of utilities for working with Telegram stickers.\n\n- Convert image formats without losing transparency.\n- Auto optimize output size for sticker, make it valid for Telegram.\n- Auto-detect sticker type and emojis.\n\n## 🛠 Supported Pack Types\n\n- [x] Video Sticker\n- [x] Static Sticker\n- [ ] Animated Sticker(Tgs)\n\n## 🚀 Installation\n\nYou need install **[ImageMagick](https://github.com/imagemagick/imagemagick)** and \n**[ffmpeg](https://www.ffmpeg.org/download.html)** before using this SDK.\n\nInstall Guide: https://docs.wand-py.org/en/0.6.12/guide/install.html\n\n```shell\napt install ffmpeg\npip3 install telegram-sticker-utils\n```\n\n## 📖 Usage\n\n```python\nimport emoji\n\nfrom telegram_sticker_utils import ImageProcessor\nfrom telegram_sticker_utils import is_animated_gif\nfrom telegram_sticker_utils.core.const import add_emoji_rule\n\ntry:\n    add_emoji_rule(\"sad\", \"😢\")\n    add_emoji_rule(\"happy\", emoji.emojize(\":smile:\"))\nexcept ValueError as e:\n    print(\"NOT emoji\")\n\nprint(is_animated_gif('test.gif'))  # Path to the image file or a file-like object.\n\nfor sticker_file in [\"happy.webp\", \"sad.png\", \"高兴.jpg\", \"悲伤.gif\"]:\n    sticker = ImageProcessor.make_sticker(\n        input_name=sticker_file,\n        input_data=open(sticker_file, 'rb').read(),\n        scale=512\n    )\n    print(sticker.sticker_type)\n    print(sticker.emojis)\n    with open(f\"{sticker_file}.{sticker.file_extension}\", 'wb') as f:\n        f.write(sticker.data)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudoskys%2Ftelegram-sticker-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudoskys%2Ftelegram-sticker-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudoskys%2Ftelegram-sticker-utils/lists"}