Emot is a python library to extract the emojis and emoticons from a text(string). All the emojis and emoticons are taken from a reliable source i.e. Wikipedia.org.
Compatibility
It works fine in any Python 2.xx and 3.xx.
Working
The Emot library takes a string as an input and returns a list of dictonary.
Example
>>> import emot
>>> text = "I love python 👨 :-)"
>>> emot.emoji(text)
>>> [{'value': '👨', 'location': [10, 10]}]
>>> emot.emoticons(text)
>>> [{'value': ':-)', 'location': [12, 15]}]
You can loop them as shown below. There are two details in each dictonary (1) Value - Emoji or Emoticons and (2) Location - starting position and the ending position of the emoji and emoticons. Below is the example showing how you can loop it.
>>> text = "I love python 👨 :-) :) "
>>> emot.emoticons(text)
[{'value': ':-)', 'location': [16, 19]}, {'value': ':)', 'location': [20, 22]}]
>>> for data in emot.emoticons(text):
... print('value ',data['value'])
... print('starting point: ',data['location'][0])
... print('ending point: ',data['location'][1])
...
value :-)
starting point: 16
ending point: 19
value :)
starting point: 20
ending point: 22
Installation
Via pip:
$ pip install emot --upgrade
From master branch:
$ git clone https://github.com/NeelShah18/emot.git
$ cd emot
$ python setup.py install
Developing
$ git clone https://github.com/NeelShah18/emot.git
$ cd emot
Links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file emot-1.0.tar.gz.
File metadata
- Download URL: emot-1.0.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d331b494f8384c6b3067d084347a781b41eec7601f945781905c4bcf003d14ec
|
|
| MD5 |
63d358512a8bdec064a6893d6f09f560
|
|
| BLAKE2b-256 |
f90bb05ffc061cde52b886bb881bddbe01c9729a7a91d67760f4b9a6fa061a4f
|
File details
Details for the file emot-1.0-py3-none-any.whl.
File metadata
- Download URL: emot-1.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8e4a4a964654db626b1f543886ce9723cf005144c036539abc905f925ccccb
|
|
| MD5 |
dc317be6ba15b3c15cdf512631e7d49f
|
|
| BLAKE2b-256 |
ee349490e4555227f6e17f744f53385e8a9bcdf0ec81d3e578493047bd7aa520
|