emoji_data.character module

class emoji_data.character.EmojiCharProperty

Bases: Enum

Emoji Character Properties

character properties are available for emoji characters.

see: http://www.unicode.org/reports/tr51/#Emoji_Properties

EMOJI = 'Emoji'

for characters that are emoji

EPRES = 'Emoji_Presentation'

for characters that have emoji presentation by default

EMOD = 'Emoji_Modifier'

for characters that are emoji modifiers

EBASE = 'Emoji_Modifier_Base'

for characters that can serve as a base for emoji modifiers

ECOMP = 'Emoji_Component'

for characters used in emoji sequences that normally do not appear on emoji keyboards as separate choices, such as keycap base characters or Regional_Indicator characters.

All characters in emoji sequences are either Emoji or Emoji_Component. Implementations must not, however, assume that all Emoji_Component characters are also Emoji. There are some non-emoji characters that are used in various emoji sequences, such as tag characters and ZWJ.

EXTPICT = 'Extended_Pictographic'

for characters that are used to future-proof segmentation.

The Extended_Pictographic characters contain all the Emoji characters except for some Emoji_Component characters.

class emoji_data.character.EmojiCharacter

Bases: object

emoji character — A character that has the Emoji property.

These characters are recommended for use as emoji.

see: http://www.unicode.org/reports/tr51/#Emoji_Characters

__init__(code_point, properties=None, comments=None)
Parameters:
classmethod initial()

Initial the class

Load Emoji Characters and it’s properties from package data file into class internal dictionary

classmethod release()
classmethod items()

Return an iterator of all code-point -> emoji-character pairs of the class

Return type:

Iterable[Tuple[int, EmojiCharacter]]

classmethod keys()

Return an iterator of each emoji-character’s key code-point of the class

Return type:

Iterable[int]

classmethod values()

Return an iterator of all emoji-characters of the class

Return type:

Iterable[EmojiCharacter]

property code_point: int

Unicode integer value of the emoji-characters

property code_point_string: str

Unicode style hex string of the emoji-characters’s code-point

eg: 25FB

property properties: List[EmojiCharProperty]

Property description text of the emoji-characters

property comments: List[str]

Comments of the Emoji

property regex: str

Regular express for the emoji-characters

property hex: str

Python style hex string of the emoji-characters’s code-pint

eg: 0x25fb

property string: str

Emoji character string

classmethod from_character(c)

Get EmojiCharacter instance from a single Emoji Unicode character

Note

c should be a single unicode character.

Parameters:

c (str) – Emoji character

Returns:

Instance returned from the class’s internal dictionary

Raises:

KeyError – When character not found in the class’ internal dictionary

Return type:

EmojiCharacter

classmethod from_hex(value)

Get an EmojiCharacter instance by Emoji Unicode integer value or it’s hex string

Parameters:

value (int | str) – Emoji Unicode, either integer value or hex string

Returns:

Instance returned from the class’s internal dictionary

Raises:

KeyError – When code not found in the class’ internal dictionary

Return type:

EmojiCharacter

emoji_data.character.TEXT_PRESENTATION_SELECTOR = 65038

The character U+FE0E VARIATION SELECTOR-15 (VS15), used to request a text presentation for an emoji character. (Also known as text variation selector in prior versions of this specification.)

emoji_data.character.EMOJI_PRESENTATION_SELECTOR = 65039

The character U+FE0F VARIATION SELECTOR-16 (VS16), used to request an emoji presentation for an emoji character. (Also known as emoji variation selector in prior versions of this specification.)

emoji_data.character.EMOJI_KEYCAP = 8419

A sequence of the following form:

emoji_keycap_sequence := [0-9#*] \x{FE0F 20E3}
  • These sequences are in the emoji-sequences.txt file listed under the type_field Emoji_Keycap_Sequence

emoji_data.character.REGIONAL_INDICATORS = [127462, 127463, 127464, 127465, 127466, 127467, 127468, 127469, 127470, 127471, 127472, 127473, 127474, 127475, 127476, 127477, 127478, 127479, 127480, 127481, 127482, 127483, 127484, 127485, 127486, 127487]

regional indicators

emoji_data.character.TAGS = [917536, 917537, 917538, 917539, 917540, 917541, 917542, 917543, 917544, 917545, 917546, 917547, 917548, 917549, 917550, 917551, 917552, 917553, 917554, 917555, 917556, 917557, 917558, 917559, 917560, 917561, 917562, 917563, 917564, 917565, 917566, 917567, 917568, 917569, 917570, 917571, 917572, 917573, 917574, 917575, 917576, 917577, 917578, 917579, 917580, 917581, 917582, 917583, 917584, 917585, 917586, 917587, 917588, 917589, 917590, 917591, 917592, 917593, 917594, 917595, 917596, 917597, 917598, 917599, 917600, 917601, 917602, 917603, 917604, 917605, 917606, 917607, 917608, 917609, 917610, 917611, 917612, 917613, 917614, 917615, 917616, 917617, 917618, 917619, 917620, 917621, 917622, 917623, 917624, 917625, 917626, 917627, 917628, 917629, 917630, 917631]

tags

emoji_data.character.ZWJ = 8205

An emoji sequence with at least one joiner character.