Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.09 KB

README.md

File metadata and controls

43 lines (31 loc) · 1.09 KB

pymoji

Build Status License

Convert emoji-cheat-sheet names to unicode and more!

Inspiration: GitHub's gemoji

Setup

python3 setup.py install

Usage

Converting emoji-cheat-sheet aliases to their escape sequences or unicode entities and vice versa:

>>> import pymoji
>>> pymoji.Emoji(":star:").char
'⭐'
>>> pymoji.Emoji(":star:").escape
'2b50'
>>> pymoji.Emoji("2b50").alias
':star:'
>>> pymoji.Emoji("2b50").aliases
[':star:']

Replacing emoji-cheat-sheet aliases in text and vice versa:

>>> pymoji.replaceAliases("I :heart: Python:exclamation:")
'I ❤ Python❗'
>>> pymoji.replaceEmoji("I ❤ Python❗")
'I :heart: Python:exclamation:'
>>> pymoji.replaceAliases("I :heart: Python:exclamation:", trailingSpaces=1)
'I ❤  Python❗ '