Registry / data / emot
library3.1pypypiunverified

Emot is a Python library designed for high-performance detection and extraction of emojis and emoticons from text, particularly useful for large-scale datasets. It utilizes advanced dynamic pattern generation based on an internal database. The current version, 3.1, released in August 2021, focuses on performance and bulk processing capabilities. The library provides details like the value, meaning, location, and presence (flag) of detected symbols.

pip install emot --upgrade
INSTALL
IMPORT
SIG · EMOT
E
emot
datapythonv3.1
Install
1.6s avg
Import
97ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.096s · 18.6MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.098s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

emot
✓ import emot
✗ from emot.emo_unicode import UNICODE_EMO, EMOTICONS
Direct import from internal modules like `emo_unicode` is not part of the public API and can break between versions. Use the main `emot` module.

Initialize the `emot` object and then use its `emoji()` or `emoticons()` methods to detect and extract symbols from a given string. The methods return a dictionary containing lists for 'value', 'location', 'mean', and a 'flag' indicating presence.

import emot # Initialize the emot object (required since v3.0) emot_obj = emot.core.emot() text_with_emojis = "I love python 👨 🙂 ❤️" text_with_emoticons = "Hello there :-) :D" text_without_emotions = "No emotions here." # Detect emojis result_emoji = emot_obj.emoji(text_with_emojis) print("Emoji detection:", result_emoji) # Expected output for v3.1: {'value': ['👨', '🙂', '❤'], 'location': [[14, 15], [16, 17], [18, 19]], 'mean': [':man:', ':slightly_smiling_face:', ':red_heart:'], 'flag': True} # Detect emoticons result_emoticon = emot_obj.emoticons(text_with_emoticons) print("Emoticon detection:", result_emoticon) # Expected output for v3.1: {'value': [':-)', ':D'], 'location': [[12, 15], [16, 18]], 'mean': ['Happy face smiley', 'Grinning face'], 'flag': True} # Handle text without emotions result_none = emot_obj.emoji(text_without_emotions) print("No emotions detection:", result_none) # Expected output for v3.1: {'value': [], 'location': [], 'mean': [], 'flag': False}
Debug
Known issues
breakingThe return type of `emoji()` and `emoticons()` methods changed significantly in v2.0. It shifted from a list of dictionaries to a single dictionary where keys (like 'value', 'location', 'mean') hold lists, and a new boolean 'flag' was introduced.
fix
Update your code to expect a dictionary output and access keys like `result['value']` instead of iterating over a list of dictionaries.
affects: >=2.0.0
breakingStarting from v3.0, `emot` requires explicit object instantiation via `emot.core.emot()`. Direct calls like `emot.emoji(text)` are no longer supported. Additionally, Python 2.x support was dropped, requiring Python 3.x.
fix
Change `import emot` to `emot_obj = emot.core.emot()` and then call methods using `emot_obj.emoji(text)`. Ensure your environment uses Python 3.x.
affects: >=3.0.0
gotchaEmojis with skin tone modifiers (e.g., 👨🏽) might be incorrectly parsed as two separate emojis (e.g., '👨' and ':medium_skin_tone:') leading to double-counting or unexpected results.
fix
Implement post-processing logic to filter out skin tone modifiers if they are not desired as individual detections. For example, check if the 'mean' field contains ':_skin_tone:' and remove such entries.
affects: All versions
Upgrade
Version history
3.1latest on PyPI · released Aug 2, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
20
OpenAI (training)
1
Resources
emot — pip install emot · libregistry