scistag.emojistag.emoji_db.EmojiDb¶
- class EmojiDb[source]¶
Bases:
objectThe Emoji DB provides Emoji and country flag graphics. By default it uses the Noto Emoji dataset embedded into the SciStag module.
Methods
Returns all emojis which match the defined search pattern
Returns a set of all (known) valid emoji sequences
Returns a list of all emoji main categories
Converts an emoji identifier to a unicode character sequence which can be printed to the console or a markdown document.
Returns details about am emoji
Returns all emojis in the defined category and subcategory
Returns all available emoji extensions
Tries to read the SVG of an emoji from the database
Returns the unicode sequence for given unicode identifier
Returns a list of all emoji sub categories of given category
Tries to read the SVG of an emoji from the database
Returns if SVG rendering is supported tne SVG repo installed
Returns if given sequence is known (in the current version) of our Emoji database.
Attributes
__dict____doc____module____weakref__list of weak references to the object (if defined)
Shared access lock
List of known emoji addon packages
Defines if the emoji db was initialized
Contains all details about every single known emoji such as name, category, subcategory and of course unicode sequence
Markdown name conversion dictionary
Defines if SVG emojis are available
The dictionary contains all official names of the emojis and their corresponding unicode sequence
Set of valid unicode sequences
- classmethod _get_main_dict()[source]¶
Returns the main dictionary containing all details about an emoji.
- Return type
- Returns
The dictionary
- classmethod _get_markdown_dict()[source]¶
Returns the markdown name dictionary. Contains all common markdown emoji names as key and their corresponding unique sequence as value
- Return type
- Returns
The dictionary
- classmethod _get_unicode_dict()[source]¶
Returns the unicode name dictionary. Contains all common emoji names as key and their corresponding unique sequence as value for more than 3600 emojis. See unicode.org for more details.
- Return type
- Returns
The dictionary
- classmethod find_emojis_by_name(name_mask, md=False)[source]¶
Returns all emojis which match the defined search pattern
- classmethod get_all_valid_sequences()[source]¶
Returns a set of all (known) valid emoji sequences
- :return A set of valid emoji sequences (all uppercased and with
an underscore separating the single elements)
- Return type
- classmethod get_character_sequence(identifier)[source]¶
Converts an emoji identifier to a unicode character sequence which can be printed to the console or a markdown document.
Does not alter the value if a unicode sequence was passed already.
- classmethod get_emojis_in_category(category, subcategory)[source]¶
Returns all emojis in the defined category and subcategory
- Parameters
category (str) – The main category’s name as obtained by
get_categories().subcategory (str | None) – The name of the subcategory. If no subcategory is provided all emojis in the category will be returned.
- Return type
- Returns
A list of all emojis in given category and subcategory
- classmethod get_extensions()[source]¶
Returns all available emoji extensions
- Return type
- Returns
Dictionary of extensions and their corresponding FileStag path to access their data
- classmethod get_sequence_for_name(identifier)[source]¶
Returns the unicode sequence for given unicode identifier
- Parameters
identifier (
str) – Either the full qualified identifier as defined by unicode.org supporting all >3600 emojis as defined by unicode.org. or the markdown shortcode enclosed by two colons such as “:deer:” as defined on GitHub.- Return type
- Returns
The unicode sequence if the emoji could be found, otherwise an empty list
- classmethod get_sub_categories(category)[source]¶
Returns a list of all emoji sub categories of given category
- classmethod get_svg_support()[source]¶
Returns if SVG rendering is supported tne SVG repo installed
- Return type
- Returns
True if high quality rendering is possible
- classmethod validate_sequence(sequence)[source]¶
Returns if given sequence is known (in the current version) of our Emoji database.
- _access_lock = <scistag.common.mt.stag_lock.StagLock object>¶
Shared access lock
- _extensions = {}¶
List of known emoji addon packages
- _initialized = False¶
Defines if the emoji db was initialized
- _main_dict = {}¶
Contains all details about every single known emoji such as name, category, subcategory and of course unicode sequence
- _markdown_names = {}¶
Markdown name conversion dictionary
- _svg_emojis = False¶
Defines if SVG emojis are available
- _unicode_names = {}¶
The dictionary contains all official names of the emojis and their corresponding unicode sequence
- _valid_sequences = {}¶
Set of valid unicode sequences