Skip to main content

Telegram sticker sets creation automated (partially).

Project description

Telegram sticker sets creation automated (partially).

Features

PyTgASU frees you from selecting files and emojis repeatedly when creating sticker sets on Telegram.

Better yet, it makes sticker sets kind of “distributable” and “installable”.

Motivation

There was a Telegram Stickers Uploader (link dead, don’t bother), but:

  1. It has limited choices of emojis
    • Well, 250. Really? This is not enough. UTR #51 4.0 defined 910 code points with Emoji_Presentation=Yes.

  2. It does not work with current Telegram Desktop
    • It does send commands through it, but it cannot upload anything. At least not for me.

And now pytgasu comes to your rescue.

Installation

Requirement

  • Python >= 3.6

Dependency

Use pip to install:

$ pip install pytgasu

or

$ git clone https://github.com/alemonmk/pytgasu.git
$ cd pytgasu
$ pip install .

Usage

Prepare set

pytgasu needs to work with set definition file for each sticker set you want to create.

Telegram also has limitations on sticker images.

You can take care of all above with this command:

$ pytgasu prepare <dir>...

At first launch it will ask you paths to some tools (namely pngquant and waifu2x-caffe), if you prefer not using any of them you can just leave it empty. This saves a yaml-formatted configuration file at ~/.pytgasu/asu.cfg.

You need to provide a descriptive name of the set, and a short name that enables you to share it with https://t.me/addsticker/<short_name>.

Finally open the generated .def file(s) with text editor of your choice to assign emojis (and only emojis, preferably copied from Telegram).

Upload sticker sets

Once you are done editing the .def file(s), let pytgasu do the heavy lifting.

$ pytgasu upload [-s] (<dir>|<path_to.def>)...

By specifying -s, you will be automatically subscribed to the set once it’s uploaded.

You have to log in to Telegram at the first run. A session file will be created at ~/.pytgasu/asu.session.

Log out of Telegram

If you have no more business with pytgasu, you may want to log it out from Telegram.

$ pytgasu logout

This terminates your session to Telegram, deletes the stored session file and its folder, saving you few clicks in other Telegram client and file manager.

Limitions & TODOs

  1. No GUI.
    • Well…I hope you are crazy enough to make one for me ;)

Contributing

You may request new features, report bugs or leave suggestions through GitHub issue, or just code and fire a pull request.

You may contact me via e-mail if you want to stay private or just don’t bother with GitHub.

Stuff in need

  • Tests. Preferably something nose uses.

  • Better documents. There’s not much to document though …

  • Feature requests. Keep it simple, don’t complicate this tool.

  • Debug. I’m not that exhaustive and may leave edge cases here and there.

Author

(c) 2017 Lemon Lam <’%s@%s’ % (‘almk’, ‘rmntn.net’)>

License

Licensed under GNU General Public License Version 3.

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

pytgasu-0.2.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytgasu-0.2.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file pytgasu-0.2.1.tar.gz.

File metadata

  • Download URL: pytgasu-0.2.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.22.0 CPython/3.6.1

File hashes

Hashes for pytgasu-0.2.1.tar.gz
Algorithm Hash digest
SHA256 aa91c892a8669ebf39cfa641be6dadf2bd9e63011fd03698dd09142d1e8e19d2
MD5 39e59c866d3bbca2bd0e0a8375ecbae1
BLAKE2b-256 ca1b81beb3729550aab3fac849b0d61355bd9b4b8333a13f530034790707ef82

See more details on using hashes here.

File details

Details for the file pytgasu-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pytgasu-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.22.0 CPython/3.6.1

File hashes

Hashes for pytgasu-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2a0f5629d462986d3887ec0be7c6d61638a99e10162160705d2945446b6f80
MD5 0a4f3cf024f1555404d6498fe9f80f45
BLAKE2b-256 b3b2980835ae36a67df4cd6c203b2872858f2dbadc5391f34b50a71ebdc58096

See more details on using hashes here.

Supported by

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