116 days ago · Tech · hide · Fediverse post

New package just landed! emojet is an emoji library for Python: it converts between emoji and their names, in both directions, plus the searching and lookup functions that go with that. It covers the core API of the emoji package, a library that been available for this job since 2014, using the same names and the same data. The difference is that emojet does the work in Rust, running 3.5x faster for conversion, 70 times faster for deconversion, and using about 40% less memory. Use emojize() to convert names to emoji: >>> import emojet >>> emojet.emojize("Python is fun :thumbs_up:") 'Python is fun 👍' …and demojize() to deconvert emoji to their names: >>> emojet.demojize("Python is fun 👍") 'Python is fun :thumbs_up:' Names come in 14 languages, plus the English aliases that GitHub and Slack use: >>> emojet.emojize("Python ist toll :daumen_hoch:", language="de") 'Python ist toll 👍' >>> emojet.emojize("Python is fun :thumbsup:", language="alias") 'Python is fun 👍' See the documentation…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town