emoji_data.character module#

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.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.)

class emoji_data.character.EmojiCharProperty(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Emoji Character Properties

character properties are available for emoji characters.

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.

EMOD = 'Emoji_Modifier'#

for characters that are emoji modifiers

EMOJI = 'Emoji'#

for characters that are emoji

EPRES = 'Emoji_Presentation'#

for characters that have emoji presentation by default

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.

final class emoji_data.character.EmojiCharacter(code_point, properties=None, version=None, description=None)[source]#

Bases: object

emoji character — A character that has the Emoji property.

These characters are recommended for use as emoji.

Parameters:
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

Example

"25FB"

property description: str#

Description comment of the Emoji

classmethod from_character()[source]#

Get an EmojiCharacter instance from a single Unicode emoji character.

Parameters:

c (str) –

A single Unicode emoji character.

Note

c should be a single Unicode character, i.e., len(c) == 1.

Return type:

EmojiCharacter

Returns:

An instance retrieved from the class’s internal dictionary.

Raises:

KeyError – If the character is not found in the class’s internal dictionary.

classmethod from_hex()[source]#

Get an EmojiCharacter instance by Emoji Unicode integer value or its hex string.

Parameters:

value (Union[int, str]) – Emoji Unicode, either an integer value or a hex string.

Return type:

EmojiCharacter

Returns:

An instance retrieved from the class’s internal dictionary.

Raises:

KeyError – If the code is not found in the class’s internal dictionary.

property hex: str#

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

Example

"0x25fb"

classmethod initial()[source]#

Initial the class

Load emoji characters and their properties from the package data file into the class’s internal dictionary.

classmethod items()[source]#

Return an iterator over all (code point, emoji character) pairs in the class.

Yields:

A tuple containing a code point and its corresponding emoji character.

Return type:

Iterator[Tuple[int, EmojiCharacter]]

classmethod keys()[source]#

Return an iterator over all code points of emoji characters in the class.

Yields:

The code point of an emoji character.

Return type:

Iterator[int]

property properties: Sequence[EmojiCharProperty]#

Property description text of the emoji-characters

property regex: str#

Regular express for the emoji-characters

classmethod release()[source]#
property string: str#

Emoji character string

classmethod values()[source]#

Return an iterator over all emoji characters in the class.

Yields:

An emoji character instance.

Return type:

Iterator[EmojiCharacter]

property version: str#

Version of the Emoji.

Example

E0.0, E0.6, E11.0

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.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.ZWJ = 8205#

An emoji sequence with at least one joiner character.