API¶
Helpers¶
-
emoji_unicode.
replace
(txt, callback)[source]¶ Replace all unicode emojis in a given text
Parameters: - txt (str) – Text source to be parsed
- callback (callable) – A callable that should accept a instance of
Emoji
and return a str to replace the match
Returns: Parsed text with all the emojis replaced by the callback result
Return type: str
-
emoji_unicode.
normalize
(code_points, separator=u'-')[source]¶ Normalize a code point removing joiner characters such as emoji variations, Zero Width Joiner and leading zeros
Parameters: - code_points (str) – code points separated by an hyphen or the separator param value
- separator (str) – The separator used to split the code points, process them and merge them back
Returns: Code points with no joiner chars, leading zeros, and lower cased.
Return type: str
Emoji Object¶
-
class
emoji_unicode.
Emoji
(unicode)[source]¶ Emoji is used in the process of
replace()
unicode emojis in a textParameters: unicode (str) – Unicode emoji -
as_map
()[source]¶ A map containing the individual unicode chars and code points. The code points are normalized as by
normalize()
Returns: Sequence of tuples of the form [(unicode, code_point)] Return type: list
-
code_points
¶ Code points representing the unicode emoji, the result is normalized as by
normalize()
Getter: Code points representing the emoji, with no joiner chars and lower cased, ie: 1f3c3-1f3fc Type: str
-